Skip to content

Instantly share code, notes, and snippets.

View dleslie's full-sized avatar

Dan Leslie dleslie

View GitHub Profile
#!/bin/bash
encfs --idle=10 --anykey --extpass="ssh-askpass Enter your EncFS Password" /home/dleslie/Dropbox/.crypt/ /home/dleslie/Documents/
thunar /home/dleslie/Documents/
#!/bin/bash
encfs --idle=10 --anykey --extpass="ssh-askpass Enter your EncFS Password" /home/dleslie/Dropbox/.crypt/ /home/dleslie/Documents/
thunar /home/dleslie/Documents/
#!/bin/bash
encfs --idle=10 --anykey --extpass="ssh-askpass Enter your EncFS Password" \
/home/dleslie/Dropbox/.crypt/ /home/dleslie/Documents/
thunar /home/dleslie/Documents/
@dleslie
dleslie / .emacs
Created October 2, 2011 19:57
Fix Quack's Font Facing to be Friendly
(custom-set-faces
'(quack-about-face ((t (:inherit font-lock-warning))))
'(quack-about-title-face ((t (:inherit font-lock-warning :weight bold :height 2.0))))
'(quack-banner-face ((t (:inherit font-lock-warning-face))))
'(quack-pltfile-dir-face ((t (:inherit dired-face-directory))))
'(quack-pltfile-file-face ((t (:inherit dired-face-file ))))
'(quack-pltfile-prologue-face ((((class color)) (:inherit dired-face-boring))))
'(quack-pltish-class-defn-face ((((class color) (background dark)) (:inherit font-lock-type-face))))
'(quack-pltish-colon-keyword-face ((t (:inherit font-lock-keyword-face))))
'(quack-pltish-comment-face ((((class color) (background dark)) (:inherit font-lock-comment-face))))
(require 'multi-mode)
(defun scheme-c-mode ()
"Mode for editing C embedded in Scheme, using multi-mode."
(interactive)
(set (make-local-variable 'multi-alist)
'((scheme-mode)
(c-mode . scheme-c-header-region)
(c-mode . scheme-c-inline-region)))
(multi-mode-install-modes))
@dleslie
dleslie / getmp3
Created December 12, 2011 00:25
wget converter from flac to mp3
#!/bin/bash
for link in `cat list.txt`; do
fname=`echo $link | awk -F"/" '{print $5}'`
wget -c --limit-rate=500k $link -qO - | flac -cd - | lame -h - "$fname.mp3"
sleep 120
done
@dleslie
dleslie / gist:1847604
Created February 16, 2012 20:27
Fuck you Microsoft
try
{
DataModel.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
}
catch (System.Data.Linq.ChangeConflictException)
{
// Microsoft sucks, good fucking luck figuring out what causes this particular exception.
}
(defun add-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name new-keywords) t) "\\)\\>")
(1 font-lock-keyword-face)))))
modes)
t)
(defun remove-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-remove-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name new-keywords) t) "\\)\\>")
@dleslie
dleslie / font-lock-keywords.el
Created February 25, 2012 22:29
Easy add/remove keywords from font lock
(defun add-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>")
(1 font-lock-keyword-face)))))
modes)
t)
(defun remove-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-remove-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>")
@dleslie
dleslie / load-scheme-tags.el
Created February 25, 2012 23:41
Load Scheme Keywords from TAGS File
(defun load-scheme-tags (scheme-tags-location)
(interactive)
(let ((existing-tags tags-table-list))
(setq tags-table-list nil)
(visit-tags-table scheme-tags-location)
(tags-completion-table)
(add-font-lock-keywords '(scheme-mode inferior-scheme-mode) tags-completion-table)
(setq tags-table-list existing-tags))
t)