This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get rid of empty directories in firefox bookmarks | |
DELETE FROM moz_bookmarks | |
WHERE type = 2 | |
AND id > 5 | |
AND id NOT IN ( | |
SELECT DISTINCT parent FROM moz_bookmarks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alert user that a job finished: | |
# lengthycmd; alert | |
# or | |
# lengthycmd | |
# <CTRL-Z> | |
# fg; alert | |
function alert() { | |
JOB=$(history 1) | |
if [[ "$JOB" == *fg\;* ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; look at diff when writing a commit message | |
(defun magit-log-show-diff () | |
(interactive) | |
(let ((content (magit-cmd-output "git" '("diff" "--cached" "-U5")))) | |
(with-current-buffer (get-buffer-create "*vc-diff*") | |
(let ((buffer-undo-list t) | |
(inhibit-read-only t)) | |
(erase-buffer) | |
(insert content)) | |
(diff-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun place-of (item tree) | |
(let ((place (place-of-1 item tree ""))) | |
(and place | |
(intern (concat "c" place "r"))))) | |
(defun place-of-1 (item tree place) | |
(cond | |
((null tree)) | |
((consp tree) | |
(let (found) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun try-complete-flyspell (old) | |
(when (not old) | |
;; use the correct dictionary | |
(flyspell-accept-buffer-local-defs) | |
(setq he-next-expand 0) | |
(he-init-string (he-dabbrev-beg) (point)) | |
;; now check spelling of word. | |
(ispell-send-string "%\n") ;put in verbose mode | |
(ispell-send-string (concat "^" he-search-string "\n")) | |
;; wait until ispell has processed word |