This file contains hidden or 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
| #!/usr/bin/runhaskell | |
| import Data.Char | |
| translate_char tmap c = helper tmap where | |
| helper [] = c | |
| helper ((c',ct):ps) | |
| | c == c' = ct | |
| | otherwise = helper ps | |
| translate_string tmap = map $ translate_char tmap |
This file contains hidden or 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
| ; http://an-animal-imagined-by-poe.tumblr.com/post/97790330928/i-have-been-busy-distracted-absent-for-the-past | |
| (defn find-in | |
| ([needle haystack] (find-in needle haystack 'x)) | |
| ([needle haystack varname] | |
| ; varname remminds us of how we got the haystack we're looking at from x | |
| (or | |
| ; base case | |
| (when (= needle haystack) | |
| varname) |
This file contains hidden or 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
| (defn swap-out! [a new-val] | |
| (loop [] | |
| (let [old-val @a] | |
| (if (compare-and-set! a old-val new-val) | |
| old-val | |
| (recur))))) |
This file contains hidden or 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
| execute pathogen#infect() | |
| let g:paredit_electric_return=0 | |
| let g:lisp_rainbow = 1 | |
| set nocompatible | |
| " create a backup of files when editing in /tmp | |
| set backupdir=~/tmp | |
| " swap file directory | |
| set dir=/tmp | |
| set background=dark |
This file contains hidden or 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
| (defn read-to-maps [rows] | |
| (let [headers (->> | |
| rows | |
| first | |
| (take-while (complement #{""})) | |
| (map keyword))] | |
| (for [row (rest rows)] | |
| (zipmap headers row)))) | |
This file contains hidden or 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
| echo "somebody should really delete this build" | |
| echo "please" | |
| echo "I keep getting messages when it fails and I can't delete it" | |
| echo "I was the one maintaining it and I'm not there anymore, so there's not much point in it" | |
| exit 0 |
This file contains hidden or 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
| echo "someone should really delete this build" | |
| echo "there's not much point in it without me there to maintain it" | |
| echo "I can't delete it anymore I don't have access" | |
| echo "and it keeps e-mailing me whenever it breaks" | |
| echo "I mean I guess I could alter this gist and make it delete itself but that sounds hard" | |
| exit 0 |
This file contains hidden or 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 | |
| 2 3 | |
| 4 5 6 | |
| 7 8 9 10 | |
This file contains hidden or 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
| compile-clojure: | |
| [java] Compiling clojure.core to /Users/michael.blume/workspace/clojure/target/classes | |
| [java] Exception in thread "main" java.lang.LinkageError: loader constraint violation: loader (instance of clojure/lang/DynamicClassLoader) previously initiated loading for a different type with name "clojure/core/VecNode", compiling:(clojure/gvec.clj:124:1) | |
| [java] at clojure.lang.Compiler.analyzeSeq(Compiler.java:6715) | |
| [java] at clojure.lang.Compiler.analyze(Compiler.java:6499) | |
| [java] at clojure.lang.Compiler.analyze(Compiler.java:6460) | |
| [java] at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5840) | |
| [java] at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5271) | |
| [java] at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3900) | |
| [java] at clojure.lang.Compiler.analyzeSeq(Compiler.java:6706) |
This file contains hidden or 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
| ; passes | |
| (let [{:keys [bar foo] | |
| :or {foo 1 | |
| bar (inc foo)}} {}] | |
| (assert (= foo 1)) | |
| (assert (= bar 2))) | |
| ; does not compile | |
| (let [{:keys [foo bar] | |
| :or {foo 1 |