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
(let [ | |
{ | |
:as blerp | |
:strs [i-am-a-string i-am-a-thread] | |
:keys [my-brain my-heart] | |
;;my-brain :my-brain | |
;;my-heart :my-heart | |
;;i-am-a-string "i-am-a-string" | |
;;i-am-a-thread "i-am-a-thread" |
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
#!/bin/bash | |
# $Id: scboot 64763 2008-11-15 14:29:58Z rwoodscorwin $ | |
usage() { | |
echo " | |
Usage: $(basename $0) [options] | |
Boot the nodes of a SiCortex system. | |
ARG ENV VARIABLE DESCRIPTION |
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
Sat Feb 21 14:29:06 EST 2015 [worker-1] ERROR - POST /classes | |
java.lang.IllegalArgumentException: Vector arg to map conj must be a pair | |
at clojure.lang.APersistentMap.cons(APersistentMap.java:35) | |
at clojure.lang.RT.conj(RT.java:562) | |
at clojure.core$conj.invoke(core.clj:83) | |
at clojure.core$merge$fn__4314.invoke(core.clj:2759) | |
at clojure.core$reduce1.invoke(core.clj:903) | |
at clojure.core$reduce1.invoke(core.clj:894) | |
at clojure.core$merge.doInvoke(core.clj:2759) | |
at clojure.lang.RestFn.invoke(RestFn.java:421) |
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
(defun ensure-clj-repl () | |
"Start a clojure repl using inferior-lisp mode" | |
(inferior-lisp "clojure-repl") | |
(set-syntax-table clojure-mode-syntax-table) | |
(clojure-font-lock-setup) | |
(supplement-clojure-font-lock)) | |
(defun clj-repl () | |
"Switch to existing clojure repl or start a new one" | |
(interactive) |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node { | |
stroke: #fff; | |
stroke-width: 1.5px; | |
} | |
.link { |
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
;; put this in ~/.lein/profiles.clj | |
{:user {:plugins [[lein-voom "0.1.0-20140716_032004-g85e4c9b"]]}} |
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 map-stateful | |
"Takes a state value and calls f with the current state value and each | |
item in coll. The state value may be updated and must be returned as | |
the first item in f's result vector. | |
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
#!/bin/bash | |
# Put this in your $PATH and call it "clojure-repl", and (setq clojure-inf-lisp-command "clojure-repl") if you're into the whole Emacs thing and you want to use inferior-lisp. | |
# Walk from $PWD up to /, looking for a .classpath file. | |
# If found, cat its contents for capture. | |
function find_dot_classpath { | |
local target_dir="$PWD" | |
local d="$target_dir" | |
while [[ "/" != $(command cd -P $d && \pwd) ]]; do |
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
def tokenize(str): | |
# regex: | |
# 1. zero or more (forgotten) spaces or commas followed by one of | |
# 2. ~@ [ ] { } ( ) ' ` ~ ^ @ | |
# --OR-- | |
# 3. a double-quoted string of any length (with newlines?) | |
# --OR-- | |
# 4. a comment (forgotten) | |
# --OR-- | |
# 5. any one-or-more char token that doesn't have any of: whitespace [ ] { } ( ) ' " ` @ , ; |
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
# Match dependency aliases like [navigator.thing :as a-thing] | |
# and recursively substitute a-thing with n-thing. | |
for alias in $(grep -r "navigator\.[^ ]\+ \+:as a-" * | awk '{print $NF}' | sed 's/[^a-z0-9-]//g' | sort -u); do | |
new=${alias/a-/n-} | |
find * -type f -exec sed -i "s/$alias/$new/g" \{\} \; | |
done |
NewerOlder