Instantly share code, notes, and snippets.

View coinstar.clj
(ns coinstar
(:import [java.time LocalDate]))
(def working? (constantly false))
(defn go
"Provided a `who` and `when`, returns the state of
a coinstar `when` the `who` goes to it.
Example:
View todo.exs
defmodule Do do
def dont think, about, it, but, please do
[think, about, it, please]
end
end
Do.dont :worry, :about, :grouping, :any, :arguments
=> [:worry, :about, :grouping, :arguments]
View strum.clj
(ns strum.core
(:refer-clojure :exclude [defn])
(:require
[clojure.spec :as spec]
[clojure.spec.test :as spec.test]))
;; ---------------------------------------------------------------------
;; Prelude
;; HACK: Currently, as of Clojure 1.9.0-alpha14, there is a bug with
View keybase.md

Keybase proof

I hereby claim:

  • I am devn on github.
  • I am devn (https://keybase.io/devn) on keybase.
  • I have a public key whose fingerprint is F782 0ED3 7BE8 3639 1130 3C76 EB31 8EE6 4426 0178

To claim this, I am signing this object:

View recursive-transient-persistent-transform.clj
(require '[clojure.walk :as walk])
;; => nil
(defn transient? [x]
(instance? clojure.lang.ITransientCollection x))
;; => #'user/transient?
(let [transients (walk/postwalk (fn [x]
(if (map? x)
(transient x)
View midijam.clj
;; http://notahat.com/midi_patchbay/
;; Create a virtual input and virtual output in MIDI patchbay
;; input name: "Overtone"
;; output name: "yourchoice"
;; In Reason, Ableton, etc. select "yourchoice"
;; as the midi input for a channel.
(ns jam.core
(:use [overtone.live]))
View cheating.clj
(defn gen-nonvariadic-invokes [f]
(for [arity (range 1 21),
:let [args (repeatedly arity gensym)]]
`(~'invoke [~@args] (~f ~@args))))
(defn gen-variadic-invoke [f]
(let [args (repeatedly 22 gensym)]
`(~'invoke [~@args] (apply ~f ~@args))))
(defn gen-apply-to [f]
View autotune.clj
(defsynth pitch-follow-1 []
(let [in (mix [(sound-in)])
amp (amplitude:kr in 0.05 0.05)
[freq has-freq] (pitch:kr in
:amp-threshold 0.02
:median 7)
out-1 (mix [(var-saw:ar (mul-add:ar 0.5 1 2)
0
(lf-noise1:kr (mul-add:kr 0.3 0.1 0.1)))])
out-2 (loop [n 6
View init.el
;;
;; paths
;;
(setq system-uses-terminfo nil)
(add-to-list 'exec-path (expand-file-name "~/bin"))
(add-to-list 'exec-path (expand-file-name "/usr/local/bin"))
(setenv "PATH" (concat (expand-file-name "~/bin")
":/usr/local/bin:"
View keybase.md

Keybase proof

I hereby claim:

  • I am devn on github.
  • I am devn (https://keybase.io/devn) on keybase.
  • I have a public key whose fingerprint is C1FC 786D C713 AFC5 CE9F 41E8 8233 12B2 4DA1 AA3D

To claim this, I am signing this object: