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 -e | |
if [ ! -f ./project.clj ]; then | |
echo "Run from a lein project directory." | |
exit 1 | |
fi | |
mkdir -p ./.fastrepl/ | |
if command -v md5 >/dev/null 2>&1; then | |
MD5=`md5 -q project.clj` |
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
/** | |
* Functional HTML library. | |
* Requires $ and _. | |
*/ | |
(function(outerScopeObj) { | |
function toHTML(x) { | |
if (x.toHTML) { | |
return x.toHTML(); |
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
(require '[clojure.contrib.seq-utils :refer [indexed]]) | |
(import (java.util.concurrent Executors ConcurrentHashMap)) | |
(defn pmapn [n f coll] | |
(let [executor (Executors/newFixedThreadPool n) | |
total (count coll) | |
results (ConcurrentHashMap. total 0.75 n)] | |
;; enqueue work | |
(doseq [[i x] (indexed coll)] | |
(.execute executor #(.put results i (f x)))) |
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
$ lein ancient | |
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: org.joda.time.ReadablePartial, compiling:(ancient/ancient_clj/v0v3v13/clj_aws_s/v0v3v10/clj_time/v0v6v0/clj_time/core.clj:1:1) | |
at clojure.lang.Compiler.load (Compiler.java:7391) | |
clojure.lang.RT.loadResourceScript (RT.java:372) | |
clojure.lang.RT.loadResourceScript (RT.java:363) | |
clojure.lang.RT.load (RT.java:453) | |
clojure.lang.RT.load (RT.java:419) | |
clojure.core$load$fn__5677.invoke (core.clj:5893) | |
clojure.core$load.invokeStatic (core.clj:5892) | |
clojure.core$load.doInvoke (core.clj:5876) |
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
;; I recommend mapping to C-c M-k | |
(defun my-cider-reset-buffer () | |
(interactive) | |
(cider-interactive-eval "(remove-ns (ns-name *ns*))") | |
(cider-load-buffer)) |
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
- redisplay_internal (C function) 3653 87% | |
- debug 3653 87% | |
- recursive-edit 3372 80% | |
- nrepl-client-filter 2894 69% | |
- nrepl--dispatch-response 2728 65% | |
- nrepl-log-message 2722 65% | |
- nrepl--pp 2698 64% | |
- nrepl--pp 2698 64% | |
- nrepl--pp 2597 62% | |
- nrepl--pp 2346 56% |
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
- redisplay_internal (C function) 19334 90% | |
- debug 19334 90% | |
- recursive-edit 15689 73% | |
- nrepl-client-filter 10656 50% | |
- nrepl--dispatch-response 10159 47% | |
- nrepl-log-message 9813 46% | |
- nrepl--pp 9800 46% | |
- nrepl--pp 9798 46% | |
- nrepl--pp 9712 45% | |
- nrepl--pp 9056 42% |
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
Kyrgyzstan | |
Cyprus | |
St Kitts & Nevis | |
Egypt | |
Chad | |
Marshall Islands | |
Myanmar, {Burma} | |
Netherlands | |
Switzerland | |
Czech Republic |
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
(ns virgil.repl | |
(:require [clojure.set :as set] | |
[clojure.tools.namespace.dir :as ctn-dir] | |
[clojure.tools.namespace.file :as ctn-file] | |
[clojure.tools.namespace.find :as ctn-find] | |
[clojure.tools.namespace.parse :as ctn-parse] | |
[clojure.tools.namespace.repl :as ctn-repl] | |
[virgil.compile :refer [compile-all-java]]) | |
(:import java.io.File | |
java.util.Arrays)) |
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 linear-interpolate | |
([] | |
(fn [rf] | |
(let [rrf (#'clojure.core/preserving-reduced rf) | |
skipped (volatile! 0) ;; n of contiguous nils | |
prev (volatile! nil)] ;; most recent value seen | |
(fn | |
([] (rf)) ;; init | |
([result] ;; completion -- skipped stay nils since no endpoint | |
(rf (reduce rf result (repeat @skipped nil)))) |
OlderNewer