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 is a sample contributor's license agreemenet |
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
javascript:(function() { | |
var e = document.getElementById('pull_request_body'); | |
if (e) { | |
if (e.value) { | |
e.value += '\n\n'; | |
} | |
e.value += ' | |
#### What does this PR do?\n\n | |
#### Any background context you want to provide?\n\n | |
#### Where should the reviewer start?\n\n |
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.around do |example| | |
ActiveRecord::Base.transaction do | |
example.run | |
raise ActiveRecord::Rollback | |
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
require 'rspec/core/formatters/progress_formatter' | |
# Custom RSpec formatter that speaks aloud using the say command, if available. | |
# Not to be taken too seriously, but fun for annoying your coworkers. | |
# Usage: bundle exec rspec -r ./say_formatter.rb -f SayFormatter spec | |
class SayFormatter < RSpec::Core::Formatters::ProgressFormatter | |
VOICES = %w[Agnes Albert Alex Bad\ News Bahh Bells Boing Bruce Bubbles Cellos | |
Deranged Fred Good\ News Hysterical Junior Kathy Pipe\ Organ | |
Princess Ralph Trinoids Vicki Victoria Whisper Zarvox] |
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
# Disallow site indexing in non-production environments | |
config.middleware.insert_before(::Rack::Lock, '::Rack::Robots') |
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 "money" | |
class Decorator < BasicObject | |
undef_method :== | |
def initialize(component) | |
@component = component | |
end | |
def method_missing(name, *args, &block) |
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 util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
var Server = function() { | |
var self = this; | |
this.on('custom_event', function() { | |
self.logSomething('custom_event'); | |
}); |
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
{ | |
"engines": { | |
"node": "0.8.x", | |
"npm": "1.1.x" | |
} | |
} |
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
# You can name your captured matches and ruby will create local variables for you automatically. | |
# The regex is on Rubular at http://rubular.com/r/HJbhamKAib | |
$ irb | |
1.9.3p0 :001 > s = "Foo Bar Bas <foo@bar.com>" | |
"Foo Bar Bas <foo@bar.com>" | |
1.9.3p0 :002 > /(?<label>.*) <(?<email>[^>]*)/ =~ s | |
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
config.middleware.insert_before(0, 'Rack::SeoRedirect') |
NewerOlder