Skip to content

Instantly share code, notes, and snippets.

View p14n's full-sized avatar

Dean Chapman p14n

View GitHub Profile
@p14n
p14n / deps.edn
Last active January 10, 2024 10:12
Lein/deps rebel cider nrepl
{
:aliases {
:rebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}}
:main-opts ["-m" "rebel-readline.main"]}
:nrebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}
nrepl/nrepl {:mvn/version "1.0.0"}
cider/cider-nrepl {:mvn/version "0.28.5"}
prestancedesign/get-port {:mvn/version "0.1.1"}}
:extra-paths ["<PATH TO repl.clj>"]
:main-opts ["-m" "repl"]}
@p14n
p14n / capture.clj
Created March 1, 2025 17:49
Ring handler to record req/responses
(defn capture
[handler]
(let [a (atom [])
_ (.addShutdownHook (Runtime/getRuntime)
(Thread. #(->> a
(deref)
(pr-str)
(spit (str "./test-requests-" (System/currentTimeMillis) ".edn")))))]
(fn
([request]