Skip to content

Instantly share code, notes, and snippets.


Kevin Downey hiredman

View GitHub Profile
View pi.clj
;; (load-file "/home/kevin/src/pi.clj")
(require '[clojure.pprint :as pp]
'[ :as io])
(def grammar
[[:program [:process 'eof?]]
[:process [:receive]]
[:process [:send]]
[:process [:par]]
View ref.clj
(set! *warn-on-reflection* true)
(defonce ref-ids (atom 0))
(declare ^java.util.concurrent.atomic.AtomicReferenceFieldUpdater ref-updater)
(deftype ARef [id
^:volatile-mutable value
View gist:c16705da66977475bf3bf75625457a41
Mar 19 03:16:39 circe systemd-oomd[483140]: Swap used (7642112000) / total (8489267200) is more than 90.00%
Mar 19 03:16:39 circe systemd[253067]: dbus-:1.2-org.freedesktop.secrets@0.service: Deactivated successfully.
Mar 19 03:16:39 circe systemd[1]: session-5.scope: systemd-oomd killed 1185 process(es) in this unit.
Mar 19 03:16:39 circe systemd-logind[1041]: Session 5 logged out. Waiting for processes to exit.
View *eshell*.txt
thursday=> (info "foo")
#:log{:z "2021-03-02T19:12:51.470Z" :v :info :n thursday :l 1 :m "foo"}
thursday=> (info "foo" {::a 1})
#:log{:z "2021-03-02T19:13:06.505Z" :v :info :n thursday :l 1 :m "foo" :thursday/a 1}
thursday=> (info "foo" (Exception.))
#:log{:z "2021-03-02T19:15:19.396Z" :v :info :n thursday :l 1 :m "foo" :thrown
#error {
:cause nil
View yield.clj
(ns com.manigfeald.yield
(:require [ :as an]
[ :as ast]
[ :as env]
[ :as an-jvm]
[ :refer [schedule]]
:refer [annotate-loops]]
[ :as e]
View scratch.clj
(require '[ :as find]
'[ :as io])
(defn infer-deps
"Given an m2 (a maven repo) and a directory of clojure source code,
make up some dependencies."
[m2 src]
(let [repo (io/file m2 "repository")]
View scratch.clj
{:port 4567
:name "my-prepl"
:accept 'clojure.core.server/io-prepl})
(with-open [s ( "localhost" 4567)
i (-> (.getInputStream s)
View cont.clj
(ns com.manigfeald.http2.cont)
(defn bind% [m f]
(fn [kont bundle]
(m (fn [value] ((f value) kont bundle)) bundle)))
(defmacro return% [value]
`(fn [kont# bundle#]
(let [v# ~value]
View scratch.clj
(require '[clojure.core.async :as async])
(defn swim [me in out rtt announcements seed f]
(when seed
(async/put! out {:op :ping :from me :to seed}))
(async/go-loop [s {}]
(let [[val chan] (async/alts!
(cons in (for [[_ v] s :when (:chan v)] (:chan v))))
to (fn []
View scratch.clj
(defn send-repl [& [obj]]
(let [in-in (
in-out ( in-in)
out-in (
out-out ( out-in)
err-in (
err-out ( err-in)]
(tap> {:repl/in ( in-out)
:repl/out ( out-in)