This file contains 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 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 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 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 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 100 | |
defp average(time) do | |
time / @sample | |
end | |
defp bench(fun) do | |
f = fn -> | |
Enum.each 1..@sample, fn _ -> fun.() end |
This file contains 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
(defun clojure-in-tests-p () | |
(or (string-match-p "test\." (clojure-find-ns)) | |
(string-match-p "/test" (buffer-file-name)))) | |
(defun midje-test-for (namespace) | |
(let* ((namespace (clojure-underscores-for-hyphens namespace)) | |
(segments (split-string namespace "\\.")) | |
(main-namespace (first segments)) | |
(filename (last segments)) | |
(test-segments (append (list "test" main-namespace "unit") (rest (butlast segments))))) |
This file contains 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
<testsuite> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="allows direct testing"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="works with `provided`"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="a private has been exposed"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="as_documentation/about_privates/how_to_refer_to_privates_in_facts.clj:35"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="as_documentation/about_privates/how_to_refer_to_privates_in_facts.clj:35"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="Here is how you must use them"></testcase> | |
<testcase classname="as-documentation.about-privates.how-to-refer-to-privates-in-facts" name="testable-privates allows dire |
This file contains 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
* ring (like RACK): | |
"Clojure web application library" | |
https://github.com/mmcgrana/ring | |
https://github.com/weavejester/lein-ring | |
* cljsbuild: | |
CloureScript helper | |
https://github.com/emezeske/lein-cljsbuild | |
* midje |
This file contains 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
(clojure.string/replace (str (type "")) "class" ""\) |
This file contains 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
(defn gen-fn | |
[n as b] | |
(let [n (symbol n) | |
as (vec (map symbol as)) | |
fn-value (eval `(fn ~n ~as ~b))] | |
(intern *ns* n fn-value))) | |
(gen-fn "user" [] '(println "I'M BEING CALLED!")) | |
((resolve (symbol (name :user)))) |