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
(fset 'gui-diff-last-failure | |
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([18 97 99 116 117 97 108 58 13 134217734 19 40 61 13 right 201326624 201326624 134217847 134217790 40 103 117 105 45 100 105 102 102 32 25 41] 0 "%d")) arg))) | |
(key-chord-define-global "xx" 'gui-diff-last-failure) |
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 g-blame () | |
"Which commits last affected this line?" | |
(interactive) | |
(shell-command | |
(format "git show $(git blame '%s' -L %s,%s | awk '{print $1}')" | |
(buffer-file-name) | |
(line-number-at-pos) | |
(line-number-at-pos)))) | |
(defun g-churn () |
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
;; 1. eval this | |
(def x 1) | |
;; 2. eval this | |
(binding [x 2] | |
(println x)) | |
;; 3. eval this | |
(.setDynamic #'x) |
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
(fset 'gui-diff-last-failure | |
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([18 97 99 116 117 97 108 58 13 134217734 19 40 61 13 right 201326624 201326624 134217847 134217790 40 103 117 105 45 100 105 102 102 32 25 41] 0 "%d")) arg))) | |
(key-chord-define-global "xx" 'gui-diff-last-failure) |
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
(->> (repeatedly (partial rand-int 26)) | |
(map #(+ % 65)) | |
(map char) | |
(take 100) | |
(apply str)) |
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
(defmacro let-map | |
"Creates a hash-map which can refer to the symbols of the names of the keys | |
declared above." | |
[& kvs] | |
(assert (even? (count kvs))) | |
(let [ks (take-nth 2 kvs) | |
sym-ks (map (comp symbol name) ks) | |
vs (take-nth 2 (rest kvs))] | |
`(let ~(vec (interleave sym-ks vs)) | |
~(apply hash-map (interleave ks sym-ks))))) |
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
;; interesting destructuring behavior I never took advantage of... | |
;; Wonder if it'd make destructuring faster to remove the seq? | |
;; checking stuff, which I did know anyone used, at least not explicitly | |
;; macroexpand: | |
(let [{:keys [a b] :as c} '(:a 1 :b 2) ] [a b c]) | |
;; => | |
(let* | |
[map__27061 |
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
(eval-after-load "sql" | |
'(progn | |
(sql-set-product 'postgres))) | |
(add-hook 'sql-mode-hook 'sql-highlight-postgres-keywords) |
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
(def commonly-used-str->keyword | |
{"precise" :precise | |
"messy" :messy | |
"active" :active | |
"control" :control}) | |
(defn fast-keywordize [k] | |
(get commonly-used-str->keyword k)) | |
(defn third-way [k] |
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
(def ^:private default -1.0) | |
(def ^:private millis-in-a-day 86400000) |
OlderNewer