Skip to content

Instantly share code, notes, and snippets.

View bcardarella's full-sized avatar
Out sailing

Brian Cardarella bcardarella

Out sailing
View GitHub Profile
@bcardarella
bcardarella / env.rb
Created January 26, 2009 00:06 — forked from jeffrafter/env.rb
Some good Cucumber Stories for Signup and Authentication
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'shoulda'
require 'webrat'
require 'factory_girl'
require 'test/factories/clearance'
require 'clearance/../../shoulda_macros/clearance'
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures
@bcardarella
bcardarella / gist:64930
Created February 16, 2009 00:45 — forked from bryanl/gist:64867
ApplScript to setup Environment from bryanl
tell application "MacVim"
activate
set bounds of the first window to {0, 0, 950, 900}
end tell
tell application "Terminal"
activate
do script "cd ~/Development"
set bounds of the first window to {945, 0, 1440, 450}
@bcardarella
bcardarella / build_ruby19.sh
Created February 18, 2009 20:15 — forked from postmodern/build_ruby19.sh
Ruby 1.8 and 1.9 side-by-side
#!/bin/sh
mkdir -p /usr/local/src && cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2
tar -xjvf ruby-1.9.1-p0.tar.bz2
cd ruby-1.9.1-p0
./configure --prefix=/usr --program-suffix=19 --enable-shared
make && make install
[*1..99].reverse.each do |i|
phrase = ["#{i} bottles of beer on the wall",
"#{i} bottles of beer",
"You take one down",
"You pass it around",
"#{i - 1} bottles of beer on the wall.."].join(".. ")
`say #{phrase}`
end
@bcardarella
bcardarella / .autotest
Created April 20, 2009 18:53 — forked from technicalpickles/.autotest
Evil Autotest has Temper Tantrums
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize
Dan Pickett, http://en.oreilly.com/rails2009/profile/46469
Brian Cardarella, http://en.oreilly.com/rails2009/profile/45790
# Install gems locally, and only locally, without gem complaining
# about path access, and ensuring access to executables.
#
# Goes in .bash_profile or .bash_login.
export GEM_PATH="$HOME/.gem/ruby/1.8"
export GEM_HOME="$HOME/.gem/ruby/1.8"
export PATH="$HOME/.gem/ruby/1.8/bin:$PATH"
rvm --create use default@myproject
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
You can generate the .rvmrc file below by running:
source 'http://rubygems.org'
gem "i18n", ">= 0.4.0"
gem 'rails', '3.0.0'
gem "haml"
gem "compass"
# gem "mongoid", "2.0.0.beta.15"