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
class Address | |
# :street, String | |
# :city, String | |
# :state, String | |
# :country, String | |
scope :local, lambda { |query| search_by_street_or_city(query, query) } | |
scope :national, lambda {|query| search_by_state_or_country(query, query) } | |
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
Running 683 tests...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................OK! | |
bin/mspec ci --background --agent | |
rubinius 2.0.0dev (1.8.7 68a5acb5 yyyy-mm-dd JI) [x86_64-apple-darwin10.8.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 'goliath' | |
require 'rack/lobster' | |
class Lobster < Goliath::API | |
map '/' do | |
run Rack::Lobster.new | |
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
<script src="http://copypastel.github.com/github-pinboard/lib/githubPinboard.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
console.log("got here"); | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.open("http://facebook.com", function(status) { | |
if ( status === "success" ) { |
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
http://cl.ly/1L1H1s1T1b2Y2x3v2G41 |
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
package main | |
/* | |
Ping vs Pong: A Gladiatorial Match | |
Two goroutines enter, only one leaves... | |
*/ | |
/* | |
#cgo LDFLAGS: -lprobes -L/usr/local/lib | |
#include "probes.h" |
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
# config/initializers/extensions/action_dispatch/routing/mapper.rb | |
module ActionDispatch | |
module Routing | |
class Mapper | |
module Resources | |
alias_method :old_add_route, :add_route | |
def add_route(action, options) | |
if @scope[:throttle] | |
throttlers = @scope.delete(:throttle) |
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
class OHash < Hash | |
def initialize(key_values) | |
key_values.each { |key, value| self[key] = value } | |
end | |
def method_missing(key) | |
if self.has_key?(key) | |
return self[key] | |
else | |
raise NoMethodError |
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 | |
# | |
# Sign the just-made commit with a globally configured GPG key. | |
git commit --amend --allow-empty --gpg-sign=`git config user.signingkey` --reuse-message=HEAD |