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_ERRORS = [ | |
Timeout::Error, | |
Errno::EADDRNOTAVAIL, | |
Errno::ETIMEDOUT, | |
Errno::EINVAL, | |
Errno::ECONNRESET, | |
Errno::ECONNREFUSED, | |
Errno::EHOSTUNREACH, | |
EOFError, | |
Net::HTTPBadResponse, |
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 'hmac-sha1' | |
require 'net/https' | |
require 'base64' | |
AWS_KEY = '...' | |
AWS_SECRET = '...' | |
CLOUDFRONT_DISTRIBUTION_ID = '...' | |
date = Time.now.utc |
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 ClassMethods | |
def my_context(description, options = {}, &block) | |
context(description) do | |
before(:each) do | |
puts "omg!" | |
end | |
after(:each) do | |
puts "win!" | |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by mdbtools configure 0.6pre1, which was | |
generated by GNU Autoconf 2.61. Invocation command line was | |
$ ./configure --prefix=/usr/local/Cellar/mdbtools/HEAD --mandir=/usr/local/Cellar/mdbtools/HEAD/share/man | |
## --------- ## | |
## Platform. ## |
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/environment.rb | |
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION | |
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
config.gem 'simplepay', :lib => 'simplepay/rails' | |
config.time_zone = 'UTC' | |
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
Warden::Strategies.add(:site_basic) do | |
def valid? | |
authorization.present? | |
end | |
def authenticate! | |
if authorization.present? | |
site = Site.find_by_identifier_and_token(*user_name_and_password) | |
site ? success!(site) : fail!("Unauthorized") |
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 Rack | |
class PrefetchKiller | |
def initialize(app, options = {}) | |
@app = app | |
end | |
def call(env) | |
google_prefetch?(env) ? head_forbidden : @app.call(env) | |
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
From 33be3517c2f8c0ec2c1d519ea40acb1e704c485a Mon Sep 17 00:00:00 2001 | |
From: Nathaniel Bibler <git@nathanielbibler.com> | |
Date: Fri, 9 Oct 2009 14:22:28 -0400 | |
Subject: [PATCH] Patch for httpclient with soap4r support | |
--- | |
lib/fake_web.rb | 1 + | |
lib/fake_web/ext/httpclient.rb | 58 ++++++++++++++++++++++++++++++++++++++++ | |
2 files changed, 59 insertions(+), 0 deletions(-) | |
create mode 100644 lib/fake_web/ext/httpclient.rb |
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
<% | |
git_branches = `cd "#{RAILS_ROOT}"; /opt/local/bin/git branch --no-color` | |
git_branch = git_branches.split("\n").detect { |b| b =~ /\A\*/ }.gsub(/\A\* /, '') | |
%> | |
common: &common | |
adapter: sqlite3 | |
timeout: 5000 | |
development: |
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 ApplicationController < ActionController::Base | |
alias_method_chain :cache_page, :subdomain | |
private | |
## | |
# Inserts the currently requested subdomain as a directory in front of the | |
# cached file location. Assuming you've moved the default page cache | |
# storage location to /public/cache, a request to app1.example.com would be |