Skip to content

Instantly share code, notes, and snippets.

View DonDebonair's full-sized avatar

Daan Debie DonDebonair

View GitHub Profile
@DonDebonair
DonDebonair / example.cljs
Last active February 27, 2016 15:33
Generate keys for children in reagent component automatically
(defmacro defcomponent [name attrs & body]
(let [i (.indexOf attrs '&)]
(if (> i -1)
(let [sym (get attrs (inc i))]
`(defn ~name ~attrs
~@(postwalk-replace {sym `(with-idx ~sym)} body)))
`(defn ~name ~attrs
~@body))))
@DonDebonair
DonDebonair / 0_reuse_code.js
Created June 24, 2014 10:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console