Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
# 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
@easierbycode
easierbycode / teamcity_reporter.html
Created September 28, 2012 01:43 — forked from rdingwall/teamcity_reporter.html
Jasmine PhantomJS event based exit
<!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>
@easierbycode
easierbycode / basic_set_ops.rb
Created September 11, 2012 18:24 — forked from scottaj/basic_set_ops.rb
Set operations
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}
@easierbycode
easierbycode / gist:2731426
Created May 19, 2012 16:33 — forked from Chris-Murphy/gist:2394143
MapBlips abridged
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({});
}
@easierbycode
easierbycode / uri.js
Created April 22, 2012 20:53 — forked from jlong/uri.js
URI Parsing with Javascript
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"
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() {
@easierbycode
easierbycode / monkey_patching.rb
Created February 29, 2012 04:25 — forked from bagwanpankaj/monkey_patching.rb
Monkey Patching done right
#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?
@easierbycode
easierbycode / fiddle.html
Created February 10, 2012 07:51 — forked from elijahmanor/fiddle.html
jQuery Private Data Should Stay Private
<!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>
@easierbycode
easierbycode / manualcall.js
Created December 22, 2011 17:38 — forked from mxriverlynn/manualcall.js
search with backbone collections
var results = new SearchResults();
results.searchTerm = "some search term";
results.fetch({
success: someView.showTheResults
});
@easierbycode
easierbycode / timeout.js
Created December 22, 2011 01:24 — forked from mxriverlynn/timeout.js
Timeout
Foo = {};
Foo.bar = function(){
alert("test");
}
setTimeout(Foo.bar, 1000); // 1 second later, alert's "test"