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
function nestParams(params) { | |
// Translates an object that has Rails style nested keys (key1[key2][key3]: value) | |
// into a nested object | |
var nested = {}; | |
_.each(params, function(value, key) { | |
createNestedObject(nested, splitKey(key), value); | |
}); | |
return nested; | |
} |
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
# Add these lines to your repo's .git/config file under the "[remote "origin"] header: | |
# fetch = +refs/heads/*:refs/remotes/origin/* | |
# fetch = +refs/pull/*:refs/pull/* | |
"git ls-remote origin | grep -E 'pull.*merge' | cut -f 2 | grep -o '[0-9]\+' | selecta | sed 's/^/refs\/pull\//; s/$/\/merge/' | xargs git checkout" |
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
user=> (defmulti even-or-odd (fn [n] (if (even? n) :odd :even))) | |
#'user/even-or-odd | |
user=> (defmethod even-or-odd :even [n] "even") | |
#object[clojure.lang.MultiFn 0x7fd6a23b "clojure.lang.MultiFn@7fd6a23b"] | |
user=> (defmethod even-or-odd :odd [n] "odd") | |
#object[clojure.lang.MultiFn 0x7fd6a23b "clojure.lang.MultiFn@7fd6a23b"] | |
user=> (even-or-odd 1) | |
"even" | |
user=> ;; oops, let's try again |
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
(defc x 1) | |
;; WORKING | |
(mx | |
'(defc= computed | |
(let [inner-binding "huh"] | |
(and x inner-binding)))) | |
;; output | |
'(def computed |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.