Skip to content

Instantly share code, notes, and snippets.

always be clojuring

vemv vemv

always be clojuring
View GitHub Profile
vemv / json_libs_equivalence_test.clj
Last active Aug 12, 2020
View json_libs_equivalence_test.clj
(ns json-libs-equivalence-test
"Includes code derived from:"
[cheshire.core :as cheshire]
[ :as io]
[clojure.test :refer [are deftest is testing]]
[jsonista.core :as jsonista]

Publishing jars to Maven easily

Occasionally one needs to use a hacked .jar:

  • You need to modify a .jar (clojure/java) in-place
  • You built a cljsjs package, and want to upload the generated .jar
  • There's some obscure java .jar that is not in Maven.

Leiningen support for floating jars has never been official, and doesn't seem to work with cljsjs.

View gist:3250136
(ns vemv
(:require [ :as io]
[clojure.string :as string])
(:import [ ZipInputStream]
[ FileOutputStream]))
(defmacro while-let
"The composition of a side-effects based while, and a single-binding let, ala if-let.\n\nAvoids loop/recur redundance."
[[sym expr] & body]
`(loop [~sym ~expr]