- Configure git.
# ~/.config/git/config
[sendemail]
confirm = auto
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = tls
smtpUser = <gmail email address>
describe ArModel do | |
context "when active" do | |
subject { ArModel.active } | |
each_subjects(:status_code) { should eql('ACTIVE') } | |
end | |
end |
# This script greps the code base for all associations with an explicit foreign_key. | |
# For each defined association, it attempts to infer the foreign_key using our inflection rules. | |
# If the inferred foreign_key matches the explicit foreign_key, then the foreign_key declaration can be removed. | |
# If not, then there is the potential that the inflection can be added to config/initializers/inflections | |
# (unless it is an exception to an already-defined initializer inflection) | |
# USAGE: run from the command line | |
# $ ruby find_redundant_foreign_keys.rb | |
root = File.expand_path(File.dirname(__FILE__) + '/../') |
require 'rubygems' | |
require 'cgi' | |
require 'json' | |
movies = Dir.open(".").select do |f| | |
File.directory?(f) && !f.match(/\..*/) | |
end | |
movies.each do |movie| | |
print "." |
var color = { | |
RGB : function(){ | |
// if (!(this instanceof color.RGB)) { | |
// return new color.RGB.apply(this, arguments); | |
// } | |
var rgb; | |
if(arguments.length === 1){ | |
rgb = (typeof arguments[0] === 'string')? color.RGB.parse(arguments[0]) : arguments[0]; | |
module MyGem | |
module VERSION | |
MAJOR=0 | |
MINOR=0 | |
PATCH=1 | |
PRE="beta" | |
def self.to_s | |
[MAJOR, MINOR, PATCH, PRE].compact.join(".") |
#!/bin/sh | |
if git diff-tree --name-only --no-color -r -m $1 $2 | fgrep -e 'Gemfile' >/dev/null 2>&1 | |
then | |
echo "\nGemfile modified: run \`bundle install\`\n" | |
fi | |
if git diff-tree --name-only --no-color -r -m $1 $2 | fgrep -e 'db/migrate' -e 'db/schema.rb' -e 'db/structure.sql' >/dev/null 2>&1 | |
then | |
echo "\nSchema modified: run \'rake db:migrate\'\n" | |
fi |
require 'aquarium' | |
require 'my_logger' | |
class MyClass | |
include MyLogger | |
def some_method | |
... | |
end |
# ~/.config/git/config
[sendemail]
confirm = auto
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = tls
smtpUser = <gmail email address>
window.fb = (b = { _e: [], ready: function(f){ b._e.push(f); } }); | |
window.fbAsyncInit = function() { | |
fb.ready = function(f){ f(); }; | |
_.invoke(fb._e, 'call'); | |
}; | |
fb.ready(function(){ console.info("facebook sdk loaded"); }); |
_.partialObject = function(func, partial_object) { | |
return function(object) { | |
return func.call(this, _.extend({}, partial_object, object)); | |
}; | |
}; |