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
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Console Reporter Spec</title> | |
<link rel="stylesheet" href="../ext/jasmine.css" type="text/css" /> | |
<script type="text/javascript" src="../ext/jasmine.js"></script> | |
<script type="text/javascript" src="../ext/jasmine-html.js"></script> |
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 'set' | |
# Union | |
Set[1,2,3] | Set[3,4,5] | |
#=> #{1,2,3,4,5} | |
# Intersection | |
Set[1,2,3] & Set[2,3,4,5] | |
#=> #{2,3} |
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 Blips = new Meteor.Collection("blips"); | |
if (Meteor.is_client) { | |
var handle = Meteor.subscribe('blips', function () {}); | |
var handleClient = Meteor.subscribe('blips_' + clientID, function () {}); | |
Meteor.call('mapBlips', box, clientID, function (error, result){ | |
BlipsClient = new Meteor.Collection('blips_' + clientID); | |
blips_client = BlipsClient.find({}); | |
} |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
describe('built-in matchers', function() { | |
describe('toBeTruthy', function() { | |
it('passes if subject is true', function() { | |
expect(true).toBeTruthy(); | |
expect(false).not.toBeTruthy(); | |
}); | |
}); | |
describe('toBeFalsy', function() { | |
it('passes if subject is false', function() { |
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
#first we create a subclass of class string | |
class MyString < String | |
end | |
MyString.new | |
# => "" | |
#now we are going to override this method by some Ruby magic | |
MyString.class_eval do | |
def empty? |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<style> |
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 results = new SearchResults(); | |
results.searchTerm = "some search term"; | |
results.fetch({ | |
success: someView.showTheResults | |
}); |
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
Foo = {}; | |
Foo.bar = function(){ | |
alert("test"); | |
} | |
setTimeout(Foo.bar, 1000); // 1 second later, alert's "test" |