Skip to content

Instantly share code, notes, and snippets.

View airblade's full-sized avatar

Andy Stewart airblade

View GitHub Profile
Then /^(?:I|they) should see the email delivered from "([^"]*?)"$/ do |text|
#current_email.should be_delivered_from(text)
should_be_delivered_from(text)
end
# Rackup file for serving up a static site from a "public" directory
#
# Useful for chucking a static site on Heroku
class IndexRewriter
def initialize(app) @app = app end
def call(env)
env["PATH_INFO"].gsub! /\/$/, '/index.html'
@app.call(env)
end
delete_all [prefix=mephisto_production/bin_logs, @name=airbladesoftware]...
size: 2
delete mephisto_production/bin_logs/mysql-bin.000001: true
size: 1
...done
@airblade
airblade / html.rb
Created May 12, 2010 09:02 — forked from mislav/html.rb
require 'nokogiri'
ugly = Nokogiri::HTML ARGF
tidy = Nokogiri::XSLT File.open('tidy.xsl')
nice = tidy.transform(ugly).to_html
puts nice
class ApplicationController < ActionController::Base
include Intercession
before_filter :load_skin
before_filter :require_user
before_filter :require_matching_skin
before_filter :require_admin
def load_skin
session.skin = Skin.for_request(request)
# PaperTrail's version class (existing code omitted for clarity).
class Version < ActiveRecord::Base
before_update :before_update_hook
after_update :after_update_hook
def before_update_hook
end
def after_update_hook
end