One instance Kate
Kate is a wonderful editor for fast editing php (css, js whatever if is text) files. Recently after upgrade to Kubuntu 9.10, I started to get disturbed from multiple instance of kate. What means is when you open a file from konqueror, system opens a new editor, instead of using existing instance.
I thought to solve that simplistic problem inside of kate. But there is no way. incoherently there is sessions. I never get use them, like konqueror's profiles.
Solution is enter system settings ->advanced tab ->file association
find kate what ever the filenames we deal with application then edit kate
goto Application tab
enter kate %U --use for command.
The "--use" keyword prevent kate to start if there is one, and file you've opened will happily open in the active kate instance.
Similar
New technique to win olimpics
At the 1968 Olympics, Dick Fosbury took the athletics world by surprise with an unusual high-jump technique.
Printing mysql_error
This is a code snipped to print mysql error.
If there is no error mysql_error returns null, thus if evaluates false and there is no output.
multiple ON DUPLICATE KEY UPDATE
Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.
multiple ON DUPLICATE KEY UPDATE
Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.
php unlink recursive
The shortest recursive delete possible.
<?php
/**
* Delete a file or recursively delete a directory
*
* @param string $str Path to file or directory
*/

