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 codec-finder | |
"Returns a function to find the first [path, format] pair in the applicable layout that matches | |
keyseq exactly." | |
[layer codec-type] | |
(let [layout-fn (memoize (fn [id] (layout :read layer id)))] | |
(fn [keyseq] | |
(let [layout (layout-fn (first keyseq))] | |
(when-let [[path format] (first (filter #(match-path? (first %) keyseq) | |
layout))] | |
(or (get format key) |
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
(-> [] | |
(given (tempid? filenameid) (conj [:db/add filenameid :file/name filename])) | |
(given (tempid? pathid) (conj [:db/add pathid :file/name path])) | |
(given (tempid? nodeid) (conj {:db/id nodeid :node/filename filenameid :node/object id})) | |
(given newpath (conj [:db/add nodeid :node/paths pathid])) | |
(given (tempid? id) (conj {:db/id id :git/sha sha :git/type type}))) |
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
{:dependencies '[[org.clojure/clojure "1.4.0"] | |
[org.clojure/clojure "1.3.0" :classifier "sources"] | |
[org.clojure/clojure "1.3.0"]]} |
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
(preprocess-repos [["foo" {:url "http://foo.com" | |
:username "u" | |
:password "p"}] | |
["bar" "http://bar.com"]]) | |
; [["foo" {:username "u", :url "http://foo.com", :password "p"}], ["bar" {:url "http://bar.com"}]] | |
(preprocess-deps '[[org.thnetos/cd-client "0.3.0" :classifier "foo"] | |
[org.clojure/tools.nrepl "0.2.0-beta2" :extension "bar"]]) | |
; [[[org.thnetos/cd-client "foo" nil] {:version "0.3.0"}] [[org.clojure/tools.nrepl nil "bar"] {:version "0.2.0-beta2"}]] |
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
FAIL in (test-merge-profile-paths) (project.clj:86) | |
expected: (= {:url "http://", :username "u", :password "p"} (-> {:repositories [["foo" {:url "http://", :creds :gpg}]], :profiles {:blue {:repositories {"foo" {:url "http://", :username "u", :password "p"}}}}} (merge-profiles [:tes :qa :blue]) :repositories last last)) | |
actual: (not (= {:username "u", :url "http://", :password "p"} {:creds :gpg, :url "http://"})) |
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
user=> (meta ^:foo [1 2 3]) | |
{:foo true} | |
user=> (meta ^:foo '(1 2 3)) | |
{:line 1} |
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
fallout:drip develop$ (export LEIN_JAVA_CMD=; time lein version) | |
Leiningen 2.0.0-SNAPSHOT on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM | |
real 0m2.368s | |
user 0m5.499s | |
sys 0m0.211s | |
fallout:drip develop$ time lein version | |
Leiningen 2.0.0-SNAPSHOT on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM | |
real 0m0.628s |
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
foo=$(./foo.sh) | |
echo "foo is '$foo'" |
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
fallout:~ master$ time lein version | |
Leiningen 2.0.0-SNAPSHOT on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM | |
real 0m2.041s | |
user 0m5.020s | |
sys 0m0.189s | |
fallout:~ master$ time LEIN_JAVA_CMD=decaf lein version | |
Leiningen 2.0.0-SNAPSHOT on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM |
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 compress-space-forward () | |
"*Replaces all spaces, tabs and newlines after point with a single space." | |
(interactive) | |
(re-search-forward "[ \t\n\r]+\\([^ \t\n\r]\\)" nil t) | |
(replace-match " \\1" nil nil)) | |
(defun compress-space-backward () | |
"*Replaces all spaces, tabs and newlines after point with a single space." | |
(interactive) | |
(re-search-backward "\\([^ \t\n\r]\\)[ \t\n\r]+" nil t) |