This file contains hidden or 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
config.action_controller.asset_host = Proc.new do |source, request| | |
non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com" | |
ssl_host = "https://asset1.backpackit.com" | |
if request.ssl? | |
case | |
when source =~ /\.js$/ | |
ssl_host | |
when request.headers["USER_AGENT"] =~ /(Safari)/ | |
non_ssl_host |
This file contains hidden or 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 Example < ActiveRecord::Base | |
includes | |
associations | |
named scopes | |
validations | |
This file contains hidden or 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
Autotest.add_hook :initialize do |autotest| | |
autotest.add_mapping %r%^test/factories/(.*)_factory.rb$% do |_, m| | |
["test/unit/#{m[1]}_test.rb", "test/functional/#{m[1]}s_controller_test.rb", | |
"test/unit/helper/#{m[1]}s_helper_test.rb"] | |
end | |
autotest.remove_mapping %r%^app/helpers/application_helper.rb% | |
autotest.remove_mapping %r%^app/helpers/(.*)_helper.rb% | |
This file contains hidden or 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
# Macro asserts that the routing of the given path is handled correctly | |
# | |
# If you don't specify a :controller it will try to guess the | |
# controller based on the current test. | |
# | |
# This tests only one half of what should_route will test. should_route | |
# uses assert_routing which combines assert_recognizes and the inverse | |
# assert_generates. | |
# | |
# Example: |
This file contains hidden or 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
# http://pablotron.org/software/wirble/ | |
# Provides "ri", history survives restart etc | |
require 'rubygems' | |
require 'wirble' | |
Wirble.init | |
# http://www.quotedprintable.com/2007/9/13/my-irbrc | |
# Show rails root in script/console prompt | |
require 'irb/completion' |
This file contains hidden or 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
(function($){ | |
$.fn.inlineLabels = function(options){ | |
var settings = $.extend({ | |
suffix: '...' | |
}, options) | |
var inputs = this.find('input[type=text]') | |
inputs.data('labelText', inputs.prev('label')) | |
this.find('input[type=text]').each(function(i, input){ |
This file contains hidden or 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 ss='./script/server' | |
alias sc='./script/console' | |
alias sg='./script/generate' | |
alias sdb='./script/dbconsole' | |
alias fixscreen='/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/VErsions/A/Resources/DMProxy' | |
alias startpg='/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile start' | |
alias stoppg='/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile stop' | |
alias reload='source ~/.profile' | |
alias m='mate' | |
alias ls='ls -G' |
This file contains hidden or 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/sh | |
echo Install Ruby | |
RUBY=ruby-1.8.6-p287 | |
curl -O http://smartic.us/assets/2008/10/5/${RUBY}.tar.gz | |
tar -zxvf ${RUBY}.tar.gz | |
cd ${RUBY} | |
./configure --prefix=/usr/local | |
make && make install | |
This file contains hidden or 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/local/bin/ruby | |
gems = ['rake', 'thin', 'mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql', 'god', 'right_aws'] | |
gems.each do |gem| | |
puts `gem install --no-rdoc --no-ri #{gem}` | |
end |
This file contains hidden or 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/sh | |
echo Updating system this could take awhile... | |
yum -y update | |
echo Installing Development Tools... | |
yum -y groupinstall "Development Tools" | |
echo Installing zlib-devel, pcre-devel, openssl... | |
yum -y install zlib-devel pcre-devel openssl openssl-devel readline-devel |