Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
describe Assignment do
describe "#percentage" do
specify do
assignment = Assignment.new(score: 5, total: 10)
expect(assignment.percentage).to eq(50)
end
end
@rockwood
rockwood / server.js
Created July 19, 2012 16:22
Node Static File Server
var http = require('http');
var fs = require('fs');
var path = require('path');
var PORT = 3000;
var INDEX = './index.html';
http.createServer(function (request, response) {
console.log('request starting...');
@rockwood
rockwood / app.js
Created February 10, 2012 20:29
Flatiron view loader
var flatiron = require('flatiron'),
path = require('path'),
plates = require('plates'),
app = flatiron.app;
app.config.file({ file: path.join(__dirname, 'config', 'config.json') });
app.use(flatiron.plugins.http);
app.use(require("./plugins/load"));
@rockwood
rockwood / gist:1562615
Created January 4, 2012 22:43
Everyauth findUserById
var UserSchema = new Schema({
email : String,
hashed_password : String,
first_name : String,
last_name : String,
salt : String,
auth_method : String,
signupDate : { type: Date, default: Date.now }
});