This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'overtone.live) | |
(def harp-s (sample (freesound-path 27130))) | |
(def dub-s (sample (freesound-path 185943))) | |
(defsynth skipping-sequencer | |
"Plays a single channel audio buffer." | |
[buf 0 rate 1 out-bus 0 beat-cnt-bus 0 beat-trg-bus 0 start-point 0 bar-trg 0 loop? 0 vol 1.0] | |
(out out-bus (* vol (scaled-play-buf 1 buf rate bar-trg start-point loop?)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AmTestTest do | |
use Amrita.Sweet | |
def user_pid do | |
{:ok, pid} = User.start_link("test") | |
end | |
#Works since user_pid is a fn that can be resolved as part of current module | |
fact "the truth" do | |
provided [Repo.find_by_email("test") |> user_pid] do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
January 16th - Classic and Beginner Guitar Brendan C & Brian W | |
February 20th - Working with Overtones Joe w | |
March 20th - Abelton Mathis P, Dominik, Ozgur | |
April 17th - Cubase Darius | |
May 15th - Signal Flow Dominik S |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Thought: Clojure destructing not supporting pattern matching means Compojure routes mix | |
; route matching and data extraction. Hence you validate within a route (since you want the extracted data). | |
; | |
; Route matching should support matching on the properties of the extracted data. | |
; A route is just a function and I want Erlang style guard statements. | |
;Now | |
(defroutes app | |
(GET "/impression/:x" [x] (when (valid? x) {:body "Woo hoo" :status 200})) | |
(ANY "*" {:status 404 :body "Not found"})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro pandoriclet (letargs &rest body) | |
(let [letargs (cons '(this) (let-binding-transform letargs))] | |
`(let (,@letargs) | |
(setq this ,@(last body)) | |
,@(butlast body) | |
(dlambda | |
(:pandoric-get (sym) | |
,(pandoriclet-get letargs)) | |
(:pandoric-set (sym val) | |
,(pandoriclet-set letargs)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget --no-clobber http://www.erlang.org/download/otp_src_R16B01.tar.gz | |
cd vendor && tar -k -xf ../otp_src_R16B01.tar.gz | |
cd vendor/otp_src_R16B01 && ./configure --without-termcap --disable-hipe --without-javac && make | |
wget --no-clobber -q http://dl.dropbox.com/u/4934685/elixir/v${ELIXIR_VERSION}.zip && unzip -o -qq v${ELIXIR_VERSION}.zip -d vendor/elixir | |
${RUN_MIX} deps.get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import time | |
import json | |
import unicodedata | |
import gevent | |
from gevent import monkey | |
from pymindwave import headset | |
from pymindwave.pyeeg import bin_power |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Future do | |
def new(fun) do | |
fn(x) -> | |
spawn_link fn -> | |
value = try do | |
{ :ok, fun.(x) } | |
rescue | |
e -> { :error, e } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Punk do | |
def hip? do | |
true | |
end | |
def hop? do | |
hip? | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Bench do | |
@sample 1000 | |
defp average(time) do | |
time / @sample | |
end | |
defp bench(fun) do | |
f = fn -> | |
Enum.each 1..@sample, fn _ -> fun.() end |