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
ActionMailer::Base.class_eval do | |
def mail_with_prefix(headers={}, &block) | |
unless Rails.env.production? | |
headers[:subject] = "[#{Rails.env.upcase}] " + (headers[:subject] || '') | |
end | |
mail_without_prefix(headers, &block) | |
end | |
alias_method_chain :mail, :prefix | |
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
# Bash alias to open Github page for project in current working directory. | |
# Will use the current active branch if it exists remotely, or falls back to master. | |
alias github='br=$(git branch --contains HEAD | sed -En "s/^\* //p"); if ! git ls-remote . | grep -q -e "refs/remotes/.*/${br}"; then br="master"; fi; open $(git config -l | sed -En "s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\2/\4/tree/${br}%p")' |
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
# .irbrc to log goodies like SQL/Mongo queries to $stdout if in Rails 3 console | |
if defined?(Rails) && Rails.respond_to?(:logger) | |
require 'logger' | |
Rails.logger = Logger.new($stdout) | |
if defined?(Mongoid) | |
Mongoid.logger = Rails.logger | |
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
import spray.http.DateTime | |
import spray.httpx.unmarshalling._ | |
/* | |
* Implicit allowing spray DateTimes to be deserialized from parameters directives. | |
* | |
* See: http://spray.io/documentation/1.2.2/spray-httpx/unmarshalling/ | |
*/ | |
// type FromStringOptionDeserializer[T] = Deserializer[Option[String], T] |
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
#!/usr/bin/env ruby | |
require 'netrc' | |
require 'octokit' | |
org_name = ARGV[0] | |
unless org_name | |
abort "Usage #{$0} org_name" | |
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
// Create a queue, but don't obliterate an existing one! | |
var analytics = analytics || []; | |
(function () { | |
// A list of all the methods we want to generate queueing stubs for. | |
var methods = [ | |
'identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', | |
'page', 'pageview', 'ab', 'alias', 'ready', 'group' | |
]; |
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 'formula' | |
class Ansible < Formula | |
homepage 'http://www.ansibleworks.com/' | |
url 'http://ansibleworks.com/releases/ansible-1.2.2.tar.gz' | |
sha1 '41672bf49ccdfcfe09a3614171a80e979304e071' | |
head 'https://github.com/ansible/ansible.git', :branch => 'devel' | |
depends_on :python => ['paramiko', 'jinja2'] |
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
[2] pry(main)> Date.today.step(Date.tomorrow, 30.minutes).each { |time| puts time } | |
2013-02-12 | |
TypeError: expected numeric | |
from (pry):2:in `step' | |
[3] pry(main)> show-source 30.minutes | |
From: /Users/ches/.rvm/gems/ruby-1.9.3-p327@REDACTED/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/time.rb @ line 39: | |
Owner: Numeric | |
Visibility: public | |
Number of lines: 3 |
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
{ | |
"id": "d8ee1407-d7e2-60a3-f905-61896360d6e3", | |
"name": "Itembase – Sandbox", | |
"values": [ | |
{ | |
"key": "api_version", | |
"value": "v1", | |
"type": "text", | |
"name": "api_version", | |
"enabled": true |