Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:4333310
Created December 19, 2012 00:09
(function(root) { // Wrap our entire code in anyonmous function. Minimise your chance to leak scope into the global namespace. See last line.
'use strict'; // http://stackoverflow.com/questions/1335851/what-does-use-strict-do-in-javascript-and-what-is-the-reasoning-behind-it
var $ = root.$; // Convient access to the jQuery object. Chaining is expensive in JS.
root.Search = (function() { // Wrap the entire class in an anonymous function. This guarantees we will not leak scope. We assign the class to the root object. In this case, window.
function Search(el) { // Create a search object. This is also the constructor for the class.
this.el = el;// Assign an ivar
}
anonymous
anonymous / gist:4316368
Created December 17, 2012 07:09
+ vendor($p,$v)
-webkit-#{$p}: $v
-moz-#{$p}: $v
-ms-#{$p}: $v
-o-#{$p}: $v
#{$p}: $v
$shadow: 0px 1px 0px rgba(#fff,0.1), 0px -1px 0px rgba(#000,0.01)
#logo
class TeamFactory
class PageValue < OpenStruct.new(:page, :name)
end
def self.build_from_individual_page page, name = nil, builder = self
value = PageValue.new page, name
team = builder.build_team value
team_page = builder.build_team_page value
builder.persist! team, team_page
team
module DelayedJob
module Matchers
def enqueue_delayed_job(handler)
DelayedJobMatcher.new handler
end
class DelayedJobMatcher
def initialize(handler)
@handler = handler
@attributes = {}
@coreyhaines
coreyhaines / .rspec
Last active August 15, 2024 15:13
Active Record Spec Helper - Loading just active record
--colour
-I app
@caged
caged / graphite.md
Created March 3, 2012 20:25
Installing Graphite on OS X Lion

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

brew install python

Check your env

$ python --version