Skip to content

Instantly share code, notes, and snippets.

@kachayev
kachayev / css-parser.md
Last active November 12, 2022 04:20
Parsing CSS file with monadic parser in Clojure
@ghadishayban
ghadishayban / weighted_rand.clj
Last active September 23, 2022 08:15
Vose's alias method for weighted randoms
(ns weighted-rand
(:import clojure.lang.PersistentQueue))
(defprotocol Rand
(nextr [_ rng]))
;; Vose's alias method
;; http://www.keithschwarz.com/darts-dice-coins/
(deftype Vose [n ^ints alias ^doubles prob]
@seandenigris
seandenigris / gist:1430706
Created December 4, 2011 17:07
Pharo Smalltalk: Access Environment Variables
OSProcess thisOSProcess environment