Skip to content

Instantly share code, notes, and snippets.

View datapimp's full-sized avatar

Jonathan Soeder datapimp

View GitHub Profile
We couldn’t find that file to show.
We couldn’t find that file to show.
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
// 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){
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}";
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.
#!/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;
var sys = require("sys")
imbot = {}
try { imbot = module.exports } catch(e){ }
(function(self){
self.bar = function(){
sys.puts("Bar")
return self
}
/ 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"
# 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