Skip to content

Instantly share code, notes, and snippets.

View emlyn's full-sized avatar

Emlyn Corrin emlyn

View GitHub Profile
with_fx :reverb do
use_synth :piano
play:E5, amp: 0.7, sustain: 1, release: 3
sleep 0.20
piano_intro
end
with_fx :reverb do
in_thread(name: :piano) do
loop do
@emlyn
emlyn / extract-text.clj
Last active December 18, 2015 12:28 — forked from jashmenn/extract-text.clj
Extract the text from a webpage using jericho html parser in clojure. Run with 'lein one-off extract-text.clj filename.html'
#_(defdeps [[net.htmlparser.jericho/jericho-html "3.1"]])
(ns foo.preprocess
(:import [java.io File BufferedInputStream FileInputStream]
[net.htmlparser.jericho Source TextExtractor HTMLElementName]))
(defn my-text-extractor [source]
(proxy [TextExtractor] [source]
(excludeElement [tag]
(= (.getName tag) HTMLElementName/PRE))))