Skip to content

Instantly share code, notes, and snippets.

# Usage:
#
# If your controller action looks like this
#
# def show
# @person = Person.find(params[:id])
# SlowPersonater(@person)
# end
#
# change it to look like this:
@jadeforrest
jadeforrest / licenses.rb
Created October 26, 2011 23:15
Quick and dirty script to extract licenses from a directory of files
#!/usr/bin/env ruby
# usage: ruby licenses.rb /path/to/directory
# credit to https://github.com/dblock/gem-licenses for the skeleton of this code
require 'iconv'
class String
# basically copying this from the core app
def to_utf8_safe
@jadeforrest
jadeforrest / rails_pet_clinic
Created September 22, 2011 20:20 — forked from tomkersten/bash.bashrc
Site setup
# File: /etc/nginx/sites-enabled/rails_pet_clinic
# easiest if you put it in /etc/nginx and symlink to sites-enabled/rails_pet_clinic
# Mostly yanked from:
# http://bit.ly/nginx-unicorn-setup
# and http://tomkersten.com/articles/nginx-unicorn-rvm-server-setup/
upstream rails-pet-clinic {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
bundle update rack activeresource acts_as_state_machine rails formtastic
require 'builder'
class Sitemap
STATIC_URLS = ['/home/about',
'/home/help',
'/home/contact_us',
'/home/terms']
class << self