Skip to content

Instantly share code, notes, and snippets.

@guns
guns / gist:1568130
Created January 6, 2012 00:13
Pascal's triangle, iterative
(defn pascals-triangle []
"Return a lazy seq of rows of Pascal's triangle."
(letfn [(next-row [row]
(reduce (fn [v' v] (conj v' (apply +' (take 2 v)))) ; (take 2) returns [1] at the right edge
[1] ; Left edge
(take (count row) (iterate rest row))))]
(iterate next-row [1])))
@guns
guns / osx-subtle-linker-fail.txt
Created August 11, 2011 17:03
OS X 10.7 SubtleWM linker failure
|| (in /Users/guns/src/subtle)
|| rm -r subtle
|| rm -r subtlext.so
|| rm -r build/subtle/shared.o
|| rm -r build/subtle/array.o
|| rm -r build/subtle/client.o
|| rm -r build/subtle/display.o
|| rm -r build/subtle/event.o
|| rm -r build/subtle/ewmh.o
|| rm -r build/subtle/grab.o
@guns
guns / modifiers.vim
Created May 7, 2011 01:48
Modifier normalization in Vim -- Meta, Mod4
We couldn’t find that file to show.