This file contains 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 'rubygems' | |
require 'sinatra' | |
before do | |
@username = session[:username] | |
p session | |
end | |
get '/' do |
This file contains 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
git svn clone -r[FROM REVISION NUMBER] svn:// #create git repository from svn repository | |
git svn rebase # get latest changes | |
git status # latest status of repository | |
git help COMMAND # get help on any command | |
git checkout -b BRANCH_NAME # create new branch | |
git branch #list branches | |
git checkout BRANCH_NAME #switch to branch | |
git merge BRANCH_NAME # merge changes from BRANCH_NAME into current branch | |
git add . # add all changes to staging area | |
git commit -m "MESSAGE" # commit changes in staging area |
This file contains 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
source 'http://rubygems.org' | |
gem 'sinatra', '>= 1.0' | |
gem "mongoid", ">=2.0.0.beta.17" | |
gem "bson_ext", ">=1.0.4" |
This file contains 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 'mongoid' | |
class Person | |
include Mongoid::Document | |
field :first_name | |
field :middle_initial | |
field :last_name | |
end |
This file contains 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 'rubygems' | |
require 'sinatra' | |
require 'mongoid' | |
configure do | |
Mongoid.configure do |config| | |
name = "demo" | |
host = "localhost" | |
config.master = Mongo::Connection.new.db(name) | |
config.slaves = [ |
This file contains 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 bob = module.exports = function(input) { | |
return { foo: "bar", | |
baz: "bar", | |
output: input | |
}; | |
}; | |
This file contains 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
Zombie: GET http://localhost:3000/ | |
Zombie: GET http://localhost:3000/ => 200 | |
Zombie: GET https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js | |
Zombie: GET http://localhost:3000/javascripts/frontpage.js | |
Zombie: GET http://localhost:3000/javascripts/frontpage.js => 200 | |
Zombie: Running script from /javascripts/frontpage.js | |
Error | |
TypeError: Cannot call method 'toString' of null | |
at /usr/local/lib/node/.npm/zombie/0.9.1/package/lib/zombie/resources.js:25:15 | |
at Resource.toString (/usr/local/lib/node/.npm/zombie/0.9.1/package/lib/zombie/resources.js:58:172) |
This file contains 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
(document).ready(function() { | |
$('#user_form').submit(function() { | |
alert('hello'); | |
return true; |
This file contains 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 'rexml/document' | |
require 'net/http' | |
require 'uri' | |
require 'rakefiles/utils' | |
namespace :release do | |
@server_url = "http://server_url" | |
@server_port = "8080" |
This file contains 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(mathStuff). | |
-export([perimeter/1]). | |
perimeter({square,Side}) -> | |
Side * 4; | |
perimeter({rectangle,A,B}) -> | |
(A * 2) + (B * 2); | |
perimeter({circle,Radius}) -> | |
Radius * 2 * 3.1415; |
OlderNewer