Skip to content

Instantly share code, notes, and snippets.

View thomaschrstnsn's full-sized avatar

Thomas Christensen thomaschrstnsn

View GitHub Profile
# disco træsko
live_loop :timer do
sleep 0.125
end
live_loop :l303 do
use_synth :tech_saws
#play choose([:c4, :f4, :e4, :fs4]), release: rrand(0.15, 0.35), cutoff: rrand(40, 130), res: 0.7
sync :timer
@thomaschrstnsn
thomaschrstnsn / stack.md
Last active November 12, 2017 19:52
haskell (stack) + atom on mac
@thomaschrstnsn
thomaschrstnsn / exercises.hs
Created November 9, 2014 12:59
Example of testing several implementations of the same function #fp101x lecture 6
check impls test = map (\(f,i) -> (i, test f))
(zip impls [1..(length impls)])
filterCorrect trs = map (\(i, _) -> i) correct
where correct = filter (\(i, b) -> b) trs
all1 p xs = and (map p xs)
all2 p xs = False -- map p (and xs)
all3 p = and . map p

Keybase proof

I hereby claim:

  • I am thomaschrstnsn on github.
  • I am thomaschrstnsn (https://keybase.io/thomaschrstnsn) on keybase.
  • I have a public key whose fingerprint is 9ACC 3CEB AD38 4594 87FD FA5F B4E1 39B6 0B18 0002

To claim this, I am signing this object:

@thomaschrstnsn
thomaschrstnsn / iterm2 cljsbuild triggers
Last active June 22, 2016 05:57
iTerm2 2.0 supports regex triggers for highlighting terminal text matching. This is a collection of regexes for cljsbuild, clojurescript.test and clojure.test highlighters
;; cljsbuild warnings
^WARNING:.* ;; yellow on black
;; cljs.test in phantom-js errors, i.e. "ReferenceError: Can't find variable: React"
^\w*rror:.* ;; red foreground
;; test success, failures, errors (red/green bar)
0 (errors|failures).* ;; green background
(?!0)\d+ (errors|failures).* ;; red background
new Uri("http://www.interwebs.com/path?query=param", UriKind.RelativeOrAbsolute).Query;
// => ?query=param
new Uri("/path?query=param", UriKind.RelativeOrAbsolute).Query;
// => InvalidOperationException: This operation is not supported for a relative URI.
@thomaschrstnsn
thomaschrstnsn / pretty-report
Created April 27, 2014 21:19
ansi-color-fied report function for clojure.test
(ns pretty-report
(:require [clojure.test :refer :all]
[clojure.stacktrace :as stack]
[io.aviso.ansi :as a]))
(defmulti pretty-report :type)
(defmethod pretty-report :default [m]
(with-test-out (prn m)))