Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am DomKM on github.
* I am domkm (https://keybase.io/domkm) on keybase.
* I have a public key whose fingerprint is E8A7 7F7C FC53 EE8E 59FA 5468 0A66 DE7B 9E89 228D
To claim this, I am signing this object:
@domkm
domkm / fsm.clj
Last active August 29, 2015 14:05
(require '[automat.core :as a])
(-> [1 2 (a/$ :conj) 3 4 (a/$ :conj)]
(a/compile {:reducers {:conj conj}})
(a/find nil [1 2 3 4])
:value)
;=> (4 2)
(-> [1 a/any (a/$ :conj) 3 4 (a/$ :conj)]
(a/compile {:reducers {:conj conj}})
@domkm
domkm / silk.clj
Last active August 29, 2015 14:05
(defrecord User [id])
; --------------------
; unmatch on Routes
(def routes
(silk/routes [[User ["users" (silk/integer :id)]]]))
(silk/unmatch routes User (User. 42)) ; you can use a record as a params map
@domkm
domkm / view.cljs
Created May 21, 2014 01:44
TypeError: Cannot read property 'firstChild' of undefined
(defn render-str [el]
(dom/render-to-str
(om/build
(fn [data owner]
(reify
om/IRender
(render [_] el)))
{})))
(render-str (dom/div nil))