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/bash | |
set -e # Exit on error | |
set -x # Print each command | |
# Set up the OpsCode repository | |
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list | |
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A | |
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg | |
apt-get update |
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 | |
# usage: | |
# $ das_download.rb email password [download_directory] | |
require 'mechanize' | |
# gem 'mechanize-progressbar' | |
email = ARGV[0] or raise('Please provide the email address for your account') | |
password = ARGV[1] or raise('Please provide the password for your account') | |
path = ARGV[2] || './' |
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
# use like so: | |
# rails new <projectname> -Tm https://raw.github.com/gist/1780315/509575d448ed95784c90abcb1ef82eac0a682714/template.rb | |
log "Running rvm" | |
run "rvm use --create --rvmrc 1.9.2@#{app_name}" | |
log "Removing index.html" | |
run "rm public/index.html" | |
generate "controller welcome index" | |
route 'root :to => "welcome#index"' |
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
module NestedFormHelper | |
def add_object_link(name, form, object, partial, where) | |
html = render(:partial => partial, :locals => { :form => form}, :object => object) | |
link_to_function name, %{ | |
var new_object_id = new Date().getTime() ; | |
var html = jQuery('#{where}').append('#{html.gsub(/\n/, ' ')}'); | |
} | |
end | |
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
$state_arr = array( | |
'Alabama' => 'AL', | |
'Alaska' => 'AK', | |
'Arizona' => 'AZ', | |
'Arkansas' => 'AR', | |
'California' => 'CA', | |
'Colorado' => 'CO', | |
'Connecticut' => 'CT', | |
'District of Columbia' => 'DC', | |
'Delaware' => 'DE', |