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 100 | |
defp average(time) do | |
time / @sample | |
end | |
defp bench(fun) do | |
f = fn -> | |
Enum.each 1..@sample, fn _ -> fun.() 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
(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 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
<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 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
* 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 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
(clojure.string/replace (str (type "")) "class" ""\) |
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
(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)))) |
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
grep -irIsE '#[[:space:]]*[[:alpha:][:digit:]]' $(find . | grep .rb) | grep -iIsE 'dead[[:space:]]*code|delete[[:space:]]*me' | wc -l |
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
Feature: Member joins a local community | |
In order to easily limit the items I buy and sell # WHY? Whats the value? | |
As a member | |
I want to join a local trading community | |
Background: | |
Given I have installed the Retrade app | |
And I am on the join a community page | |
Scenario: Allow access to browser location |
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
WORD "young" | |
SYLLABLES ("young") | |
SOUNDS ("y" "uh" "ng") | |
SYLLASOUNDS (("y" "uh" "ng")) | |
STRESS 1 | |
RHYME ("uh" "ng") | |
RHYTHM (1) | |
beep: | |
YOUNG y ah ng |
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
#!/usr/bin/env python | |
EMR_COMMAND = os.path.expanduser('~/elastic-mapreduce/elastic-mapreduce') | |
EMR_LOGGING_DIR = "s3://songkick/emr-logs" | |
def create_pig_job_flow(pigscript, num_instances=1, extraArguments=[]): | |
jobname = "Pig_Daily_" + datetime.datetime.now().strftime('%Y%m%d-%H%M%S') | |
print "Creating pig job flow", jobname, pigscript | |
args = [EMR_COMMAND, | |
"--create", |