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 'aquarium' | |
require 'my_logger' | |
class MyClass | |
include MyLogger | |
def some_method | |
... | |
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
#!/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 |
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 MyGem | |
module VERSION | |
MAJOR=0 | |
MINOR=0 | |
PATCH=1 | |
PRE="beta" | |
def self.to_s | |
[MAJOR, MINOR, PATCH, PRE].compact.join(".") |
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 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]; | |
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 'cgi' | |
require 'json' | |
movies = Dir.open(".").select do |f| | |
File.directory?(f) && !f.match(/\..*/) | |
end | |
movies.each do |movie| | |
print "." |
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
# 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__) + '/../') |
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 ArModel do | |
context "when active" do | |
subject { ArModel.active } | |
each_subjects(:status_code) { should eql('ACTIVE') } | |
end | |
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
#map{ | |
background:url(/_layouts/images/advics.internet.branding/map.png) #FFFFFF; | |
height:448px; | |
position:relative; | |
} | |
#map ul { | |
list-style:none; | |
} | |
.maplocation { | |
position:absolute; |
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
CmdUtils.makeBookmarkletCommand({ | |
name: "radbox", | |
url: "javascript:function%20addvid(){var%20d=document,%20z=d.createElement(%27scr%27+%27ipt%27),%20b=d.body;try%20{if(!b)%20throw(0);r=Math.floor(Math.random()*100+1);z.setAttribute(%27src%27,%20%27http://radbox.me/init/static/add.js?r=%27+r.toString());b.appendChild(z);}%20catch(e)%20{alert(%27Please%20wait%20until%20the%20page%20has%20loaded.%27);}}if(window.location.hostname.search(%27radbox%27)%20==%20-1)%20{addvid();}%20else%20{alert(%27You%20cannot%20use%20this%20bookmarklet%20in%20Radbox.%27);}void(0);" | |
}) |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>YQL</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
(function($){ |