Skip to content

Instantly share code, notes, and snippets.

View jacobobryant's full-sized avatar

Jacob O'Bryant jacobobryant

View GitHub Profile
@jacobobryant
jacobobryant / data-readers.md
Last active March 25, 2022 16:06
refreshing namespaces breaks *data-readers*

If you call clojure.tools.namespace.repl/refresh before requiring any namespaces referenced in data_readers.clj, then *data-readers* gets messed up somehow. The readers you define in data_readers.clj won't work even if you require their namespaces. For example:

$ find -type f
./src/foo/core.clj
./src/data_readers.clj
./src/user.clj
@jacobobryant
jacobobryant / local-root.md
Last active May 24, 2019 22:01
tools.deps bug with :local/root?

On a project I'm working on, this gives me an error:

$ clj -Sdeps '{:deps {trident/build {:local/root "/home/arch/dev/trident/target/build"}}}' \
>     -m trident.build reset
Exception in thread "main" Syntax error compiling at (trident/build/util.clj:1:1).
...
Caused by: java.lang.ClassNotFoundException: jnr.posix.POSIXFactory
...

(I have (:import (jnr.posix POSIXFactory))) in that file).

@jacobobryant
jacobobryant / deploy.cljs
Created May 10, 2019 19:31
Script for automating Datomic Cloud Ion push + deploy
#!/usr/bin/planck
(ns deploy.core
(:require [cljs.reader :refer [read-string]]
[planck.shell :as shell]))
(defn sh [& args]
(let [result (apply shell/sh args)]
(if (= 0 (:exit result))
(:out result)
(throw (ex-info (:err result) {})))))