This file contains hidden or 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
when LB_FAILED { | |
HTTP::respond 503 content "System down for maintenance" noserver "Connection" "close" | |
} |
This file contains hidden or 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
# PH'NGLUI MGLW'NAFH! | |
# IA IA IA! | |
module SubrequestHelper | |
def get_subrequest_for_uri( uri ) | |
sub_env = request.env.dup | |
sub_env['REQUEST_URI'] = uri | |
sub_env['REQUEST_METHOD'] = 'GET' | |
sub_env['rack.input'] = StringIO.new("") | |
sub_env.delete('QUERY_STRING') | |
sub_env.delete_if { |k,v| k =~ /^action_controller/ } |
This file contains hidden or 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 'delayed_job' | |
module DelayedJobHelper | |
def self.included(klass) | |
klass.class_eval <<-RUBY | |
extend ClassMethods | |
RUBY | |
end | |
module ClassMethods |
This file contains hidden or 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/bash | |
ls -l --time-style="+%Y-%m-%d" *.?.gz | awk '{ print $7,$6 }' | \ | |
while read line; do | |
set -- $line | |
original=$1 | |
datestamp=$2 | |
filebase=`echo $original | rev | cut -f3- -d. | rev` | |
/bin/mv -vu $original $filebase.$datestamp.gz | |
done |
This file contains hidden or 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
ActionController::Routing::Routes.draw do |map| | |
... | |
end | |
module CustomRoutes | |
protected | |
def incident_url( record, options = {} ) | |
account_application_alert_url(record.account_id, record.application_id, record.id, options) | |
end |
This file contains hidden or 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
[user] | |
name = Your Name | |
email = [email protected] | |
[github] | |
user = github_user_name | |
token = XXXXXXXXXXXXXXXXXXXXXXXXX | |
[color] | |
status = auto | |
diff = auto | |
branch = auto |
This file contains hidden or 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
development: | |
strategy: oauth | |
oauth_consumer_key: YOUR_KEY_HERE | |
oauth_consumer_secret: YOUR_SECRET_HERE | |
base_url: "https://twitter.com" | |
authorize_path: "/oauth/authenticate" | |
api_timeout: 10 | |
remember_for: 14 # days | |
oauth_callback: "http://localhost:3000/oauth_callback" | |
test: |
This file contains hidden or 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 | |
# Bundler needs to find the Gemfile in the current directory, so we | |
# need to dereference symlinks, then chdir to where this script lives | |
this_file = __FILE__ | |
while( File.symlink?(this_file) ) | |
this_file = File.readlink(this_file) | |
end | |
Dir.chdir(File.dirname(this_file)) |
This file contains hidden or 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 ActionController | |
module StatusCodes #:nodoc: | |
# Defines the standard HTTP status codes, by integer, with their | |
# corresponding default message texts. | |
# Source: http://www.iana.org/assignments/http-status-codes | |
STATUS_CODES = { | |
100 => "Continue", | |
101 => "Switching Protocols", | |
102 => "Processing", |