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
#!/bin/zsh | |
# Fixes ssl certificate errors with Ruby 1.9.3 when using RVM | |
if [[ -s $HOME/.rvm/usr/ssl ]] ; then curl http://curl.haxx.se/ca/cacert.pem -o ~/.rvm/usr/ssl/cert.pem ; fi | |
if [[ -s /usr/local/etc/openssl ]] ; then curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/etc/openssl/cert.pem ; fi |
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 requires you install the command line tools from Amazon, and setup your Amazon credentials appropriately. | |
# - http://aws.amazon.com/developertools/351/ | |
for region (us-east-1 us-west-1 us-west-2) ec2-import-keypair $USER -f ~/.ssh/id_rsa.pub --region $region |
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
# Steps to reproduce the problem | |
rails new my_app | |
cd my_app | |
echo "gem 'instrumental_agent', '0.9.0'" >> Gemfile | |
bundle | |
rake -T |
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 | |
before_filter :delay_xhr | |
protected | |
def delay_xhr | |
session[:delay_ajax] = params[:delay_ajax].to_i unless params[:delay_ajax].blank? | |
sleep session[:delay_ajax] if !session[:delay_ajax].nil? && session[:delay_ajax] > 0 && request.xhr? | |
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
Steps to migrate a Rails 2.3 project to bundler. | |
1. Install bundler | |
gem install bundler | |
2. Remove existing vendor gems directory | |
rm -rf vendor/gems |
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
# Selenium | |
SELENIUM_JAR=`ruby -rrubygems -e 'require "webrat";\ | |
Webrat.configuration.mode = :selenium; \ | |
print Webrat::Selenium::SeleniumRCServer.new.jar_path'` | |
alias selenium="java -jar $SELENIUM_JAR -singleWindow" |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'webrat' | |
Webrat.configuration.mode = :selenium | |
selenium = Webrat::Selenium::SeleniumRCServer.new | |
puts "java -jar "+selenium.jar_path+" -singleWindow" | |
system("java -jar "+selenium.jar_path+" -singleWindow") |
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
--type-add=ruby=.haml,.rake,.rsel,.spec,.feature |
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
alias vmware='ssh -X -f -q sqm@sqm-vm-server bin/start-vmware-console.sh' |
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
############################################### | |
# place in /app/helpers/application_helper.rb # | |
############################################### | |
def bodytag_id | |
a = controller.controller_name.underscore | |
b = controller.action_name.underscore | |
"#{a}-#{b}".gsub(/_/, '-') | |
end | |
def bodytag_class |