Skip to content

Instantly share code, notes, and snippets.

@jafingerhut
jafingerhut / project.clj
Last active August 29, 2015 14:22
Tiny Leiningen project.clj file with dev dependency on criterium
(defproject useclj16 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.6.0"]]
:profiles {:dev {:dependencies [[criterium "0.4.3"]]}})
;; Latest tools.analyzer.jvm as of Jul 29 2015 commit.
;; Clojure 1.8.0-alpha2 behavior (and I think for many previous
;; Clojure versions)
user=> (require '[clojure.tools.analyzer.jvm :as taj])
nil
user=> (def x (taj/analyze '(defn foo [x] "Not a doc string" (* x x))))
#'user/x
@jafingerhut
jafingerhut / project.clj
Created May 1, 2018 16:41
Locally modified version of Sophia-Gold/anaphora project.clj file I tried
(defproject anaphora "0.1.0-SNAPSHOT"
:url "https://medium.com/@sophiagoldnyc/anaphora"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0-master-SNAPSHOT"]
[org.clojure/data.avl "0.0.17"]
[org.clojure/data.int-map "0.2.4"]
[org.clojure/math.combinatorics "0.1.4"]
[org.clojure/tools.analyzer "0.6.9"]
[org.clojure/tools.analyzer.jvm "0.7.2"]
@jafingerhut
jafingerhut / cljs-with-redefs-on-core-fn.cljs
Created August 9, 2019 13:33
Does with-redefs work for functions in cljs.core, e.g. like vector in this example?
;; Command to start ClojureScript REPL:
;; clj -Sdeps "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" -m cljs.main --repl-env node
(defn wrapme [wrapped-fn a another-fn]
(fn [& args]
(println "called wrapped fn")
(let [ret (apply wrapped-fn args)]
(apply another-fn a ret args)
ret)))
@jafingerhut
jafingerhut / cljs-repl-with-core.matrix-deps.edn
Created October 2, 2019 18:42
Creating a cljs REPL from terminal using deps.edn and clj command
;; Save this file as deps.edn in some directory that doesn't already
;; have such a file.
;; You must have the following installed for the command below to have
;; a chance of working:
;; + A JDK, e.g. from AdoptOpenJDK web site: https://adoptopenjdk.net
;; + Clojure CLI tools. Install instructions here:
;; https://clojure.org/guides/getting_started
;; + Node.js JavaScript runtime environment. Some prepackaged ways to
@jafingerhut
jafingerhut / cljs-repl-with-core.matrix-deps.edn
Last active October 2, 2019 19:44
Creating a cljs REPL from terminal using deps.edn and clj command
;; Save this file as deps.edn in some directory that doesn't already
;; have such a file.
;; You must have the following installed for the command below to have
;; a chance of working:
;; + A JDK, e.g. from AdoptOpenJDK web site: https://adoptopenjdk.net
;; + Clojure CLI tools. Install instructions here:
;; https://clojure.org/guides/getting_started
;; + Node.js JavaScript runtime environment. Some prepackaged ways to