Skip to content

Instantly share code, notes, and snippets.

View jwilger's full-sized avatar

John Wilger jwilger

View GitHub Profile
map.resources :projects do |project|
project.contact_vendors 'project_vendors', :controller => 'project_vendors', :action => 'contact',
:conditions => { :method => :put }
project.resources :project_vendors
end
DEPS_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'deps'))
SRC_DIR = File.join(DEPS_DIR, 'src')
BIN_DIR = File.join(DEPS_DIR, 'bin')
GEM_DIR = File.join(DEPS_DIR, 'lib', 'ruby', 'gems', '1.8', 'gems')
desc 'Setup to run before working on project'
task :setup => :build do
exec "ADDPATH='#{BIN_DIR}' zsh"
end
Recipe comes from Alton Brown's "I'm Just Here for the Food", although this is coming from memory as I don't have the book in front of me:
Roasted Tomatoes
Ingredients:
* 20 ripe tomatoes, cut in half crosswise (perpendicular to stem)
* about 1/2 cup extra virgin olive oil
* about 3 tablespoons of sugar
* a few tablespoons of fresh, minced herbs including sage, rosemary and thyme
Recipe comes from Alton Brown's "I'm Just Here for the Food", although this
is coming from memory as I don't have the book in front of me:
Roasted Tomatoes
Ingredients:
* 20 ripe tomatoes, cut in half crosswise (perpendicular to stem)
* about 1/2 cup extra virgin olive oil
* about 3 tablespoons of sugar
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar http://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 23rd August 2010:
# Using ProjectDX homebrew fork. Unless you're part of the ProjectDX team, you
# probably don't want this, as we may be spec'ing older versions to match our
# production environment.

Two-Bean Quinoa Salad with Lemon Vinaigrette and Deep-Fried Bananas

Makes about 8 servings

Ingredients:

  • 2 ears of yellow corn, still in husk
  • 3/4 cup red quinoa, well-rinsed
  • 3/4 cup white quinoa, well-rinsed
  • 15 oz can of black beans, drained and rinsed
@jwilger
jwilger / ruby_bug_eh.txt
Created December 5, 2010 01:05
Not sure if this is an interpreter bug or just a misunderstanding on my part.
ree-1.8.7-2010.02 > s.each do |x|
ree-1.8.7-2010.02 > begin
ree-1.8.7-2010.02 > puts '%02d' % x
ree-1.8.7-2010.02 ?> rescue ArgumentError => e
ree-1.8.7-2010.02 ?> puts e
ree-1.8.7-2010.02 ?> end
ree-1.8.7-2010.02 ?> end
01
02
03
@jwilger
jwilger / install_pow_with_apache_proxy.sh
Created April 20, 2011 22:53
Run this file to instal 37signals' Pow but use an Apache proxy instead of the firewall rule.
curl get.pow.cx/install.sh | sh
# We don't actually want the firewall rule that pow installs
echo "Get rid of those silly firewall rules for port 80."
ports=($(ruby -e'puts $<.read.scan(/fwd .*?,([\d]+).*?dst-port ([\d]+)/)' "/Library/LaunchDaemons/cx.pow.firewall.plist"))
HTTP_PORT=${ports[0]}
DST_PORT=${ports[1]}
RULE=$(sudo ipfw show | (grep ",$HTTP_PORT .* dst-port $DST_PORT in" || true) | cut -f 1 -d " ")
[[ -n "$RULE" ]] && sudo ipfw del "$RULE"
# Unload the firewall plist and remove it.
@jwilger
jwilger / gist:1175717
Created August 27, 2011 18:39
Yay for #tap
let(:some_thing) { mock_model(SomeThing) }
let(:exception) do
ActiveRecord::RecordInvalid.allocate.tap do |e|
e.stub!(record: some_thing)
end
end
@jwilger
jwilger / Gemfile
Created November 15, 2011 18:33
Cucumber and therubyracer not getting along :-(
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'pg'
gem 'json'
gem 'therubyracer', :require => 'v8'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'