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
describe "the fee structure" do | |
describe "for a private group with 2 attendees collecting 1000.00 total" do | |
create_group_with_attendees(:all,:confirmed_attendees => true, :attendee_count => 2, :group_attributes => {:amount=>1000.00,:amount_type=>"total"}) | |
it "should have a total amount of 1000.00" do | |
@group.amount.should == 1000.00 | |
end | |
it "should have a paying attendee count" do | |
@group.paying_attendee_count.should == 3 |
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
// piping code into this script | |
// like echo "alert('hi')" |./this-script | |
// | |
// products 1 ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@alert('hi') | |
// | |
var stdin = process.openStdin(), | |
code = '' | |
stdin.setEncoding('utf8') | |
stdin.on("data",function(chunk){ |
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
if (maximum_attendees >= 1) { | |
// if the amount specified is a total amount | |
// instead of a per person amount | |
if (total) { | |
explanation1 = 'Each friend will pay {share_per_person} plus a processing fee ' + 'of {fee_per_person}. You will collect {initiator_payout}' + ' (your share is factored in).'; | |
explanation2 = 'If all spots are filled, you will collect {maximum_collection}'; | |
} else { | |
explanation1 = "The minimum amount you will collect is {minimum_collection}"; |
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
Here are some javascript projects I am watching closely | |
Trying to think of a good front end stack to put together | |
for a large app I am working on | |
head.js ( http://www.headjs.com ) | |
--------------------------------- | |
Asynchronous script loading is better than putting every javascript | |
file in a single asset and loading it at the end if your body. | |
Also has modenizr type functionality. |
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
#!/bin/bash | |
PASTEL='{ | |
"Ansi 0 Color" = { | |
"Blue Component" = 0.3097887; | |
"Green Component" = 0.3097887; | |
"Red Component" = 0.3097887; | |
}; | |
"Ansi 1 Color" = { | |
"Blue Component" = 0.3764706; |
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
var sys = require("sys") | |
imbot = {} | |
try { imbot = module.exports } catch(e){ } | |
(function(self){ | |
self.bar = function(){ | |
sys.puts("Bar") | |
return self | |
} |
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
/ just write your markup as css selector rules, the default tag is div | |
#html-id.html-class | |
/ nest things by indenting, never have to worry about closing tags again | |
/ specify tag name with % | |
%ul | |
%li.selected= "If you use an equal sign at the end of a tag, you can embed code" | |
- 3.times do |i| | |
%li= "If you use a - sign it won't output the result of that particular code, useful for control structures like loops ifs etc" |
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
# assignment is pretty | |
# you never have to worry about typing 'var' | |
# and no need to wrap args in () | |
fs = require "fs" | |
sys = require "sys" | |
global.client = require "./client" | |
args = process.argv.slice 2 | |
# i like that in coffeescript | |
# you automatically return the last statement |