Instantly share code, notes, and snippets.

Sean Corfield seancorfield

View GitHub Profile
View stacktrace.txt
Exception in thread "Thread-81" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at clojure.lang.RT.classForName(
at clojure.lang.RT.classForName(
at clojure.lang.RT.loadClassForName(
at clojure.lang.RT.load(
at clojure.lang.RT.load(
at clojure.core$load$fn__6653.invoke(core.clj:6071)
at clojure.core$load.invokeStatic(core.clj:6070)
View stacktrace.txt 745
java.util.concurrent.ThreadPoolExecutor$ 617
java.util.concurrent.ThreadPoolExecutor.runWorker 1142 266
clojure.core/binding-conveyor-fn/fn core.clj: 2022
boot.core/boot/fn core.clj: 1031
boot.core/run-tasks core.clj: 1021
boot.user$eval1637$fn__1638$fn__1647$fn__1648.invoke : 663

Running this code:

clj -Sdeps '{:deps 
              {:git/url ""
               :sha "cfde3c2c83379e93ab1a49752611ae663008129f"}}}'

That starts a REPL:

user=> (require '[map-utils :refer [map-vals map-keys]])
View adam.clj
(defn do-it []
(let [a ["a" "b" "c"]
b ["x" "y" "z"]
counter (atom 0)]
(run! (fn [foo]
(reset! counter 0)
(run! (fn [bar]
(swap! counter inc)
(println {:counter @counter
:foo foo
View async_pmap.clj
(ns async-example.core
(:require [clojure.core.async :refer [chan go >! <!!]])
(defn my-pmap [f col]
(let [chans (repeatedly (count col) chan)]
(doseq [[c e] (map vector chans col)]
(go (>! c (f e))))
(map <!! chans)))
View gist:8f62615233244820c8db
(ns example
(:require [reagent.core :as r :refer [atom]]
[reagent.cursor :as c]))
(defn input [prompt val]
[:input {:value @val
:on-change #(reset! val (.-target.value %))}]])
View gist:8285619
<cfprocessingdirective pageencoding="utf-8">
#replaceNoCase("LİELİELİELİE....","E","a very long string to replace E","all")#
View gist:8232204
writeOutput("closure? " & isClosure(function() { return "yes"; }));
writeOutput("function? " & isCustomFunction(function() { return "no"; }));
View gist:3222856
(:require [ :refer :all]
[expectations.scenarios :refer [expect scenario]]))
(set-driver! {:browser :firefox} ""))
(to "")
(expect "Arab Dating" (text ".footer p a"))
View gist:2223662
(defproject monads "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:repositories [["sonatype-snapshots" ""]]
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/algo.monads "0.1.3-SNAPSHOT"]])