Skip to content

Instantly share code, notes, and snippets.

View mnewt's full-sized avatar

Matthew Newton mnewt

View GitHub Profile
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

(defun source (filename)
"Update environment variables from a shell source file."
(interactive "fSource file: ")
(message "Sourcing environment from `%s'..." filename)
(with-temp-buffer
(shell-command (format "diff -u <(true; export) <(source %s; export)" filename) '(4))
(let ((envvar-re "declare -x \\([^=]+\\)=\\(.*\\)$"))
@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@steveklabnik
steveklabnik / log.txt
Created August 19, 2012 09:59
A fun shell script from #euruku
$ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
610 git status
568 git commit -m
491 git add .
252 git push origin
176 bundle
138 rails s
128 ls
120 git commit --amend
114 git reset --hard