Skip to content

Instantly share code, notes, and snippets.

View stringbot's full-sized avatar

Josh Davison stringbot

View GitHub Profile
### Keybase proof
I hereby claim:
* I am stringbot on github.
* I am stringbot (https://keybase.io/stringbot) on keybase.
* I have a public key whose fingerprint is 8AE0 D9D6 D5EA BC6D D8E9 C8E7 C855 1036 A95E B754
To claim this, I am signing this object:
@stringbot
stringbot / fm_ops.clj
Last active January 2, 2016 23:09
First attempt at a macro-based FM synth in Clojure.
(ns overtone-fun.fm-ops
(:use [overtone.live]))
(defmacro amp-sine [hz amp]
(let [* #'overtone.sc.ugen-collide/*]
`(~* (sin-osc ~hz) ~amp)))
(defmacro fm-op [hz1 amp1 hz2 amp2]
(let [+ #'overtone.sc.ugen-collide/+]
`(amp-sine (~+ ~hz1 (amp-sine ~hz2 ~amp2)) ~amp1)))
@stringbot
stringbot / fib_promo.rb
Last active December 10, 2015 13:28
The Fibonacci Promotion Schedule Generator
require 'active_support/time'
start = "2012-11-30"
gens = 20
def fib_series(accum,limit)
accum ||= [1,1]
return accum if accum.length >= limit
this = accum[-1]
Warszawa:Desktop josh$ irb
>> require 'hpricot'
=> true
>> html = "<html>
<textarea><iframe></iframe></textarea>
</html>"
=> "<html>\n<textarea><iframe></iframe></textarea>\n</html>"
>> Hpricot(html)/'textarea'
=> #<Hpricot::Elements[{emptyelem <textarea>}]>