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
w = 200 | |
h = 200 | |
r = 40 | |
two_values_data = [{name: "foo", value:123, color:"#0000FF"}, {name:"bar", value:456, color:"#FF0000"}] | |
one_value_data = [{name: "foo", value:123, color:"#0000FF"}] | |
vis = d3.select("body") | |
arc = d3.svg.arc().innerRadius(r * .5).outerRadius(r) |
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
w = 500 | |
h = 300 | |
x = null | |
y = null | |
intervalTime = 500 | |
data = d3.range(100).map((n) -> Math.round(Math.random() * 100)) | |
setInterval( | |
() -> |
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
girlbody = { | |
'linsey' => { | |
:chests => '36', | |
:busts => '46', | |
:waists => '26', | |
:hipss => '38' | |
}, | |
'deborah' => { | |
:chests => '34', | |
:busts => '40', |
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
class Person | |
def initialize(first_name, last_name) | |
@first_name = first_name | |
@last_name = last_name | |
end | |
def full_name | |
@first_name + @last_name | |
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
Scenes::load | |
Given /^the scene "(.+)"$/i do |scene_name| | |
Scenes::Scene[scene_name].play | |
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
Scenes::Character.named("David") { | |
u = User.create(:name => "David") | |
u.activate! | |
u | |
} |
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
Scenes::Character.named("David") { | |
User.create(:name => "David") | |
} | |
Scenes::Character.named("Joe") { | |
User.create(:name => "Joe") | |
} | |
Scenes::Scene.named("David and Joe") { | |
Scenes::Character["David"] |
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
require 'rake/clean' | |
INCLUDE = "include" | |
ERLC_FLAGS = "-I#{INCLUDE} +warn_unused_vars +warn_unused_import" | |
SRC = FileList['src/*.erl'] | |
OBJ = SRC.pathmap("%{src,ebin}X.beam") | |
CLEAN.include("ebin/*.beam") | |
directory 'ebin' |
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
-module(utils). | |
-compile(export_all). | |
-ifdef(EUNIT). | |
-include_lib("eunit/include/eunit.hrl"). | |
-endif. | |
double(X) -> | |
X * 2. |