Skip to content

Instantly share code, notes, and snippets.

@zapnap
zapnap / ec2-rubber-aws-ses-email.txt
Created March 5, 2011 17:17
Add Amazon SES support to Rubber / EC2 config
# ------------------------
# add the following packages to rubber.yml:
# ------------------------
packages: [postfix, libio-socket-ssl-perl, libxml-libxml-perl, unzip]
# ------------------------
# add to config/rubber/custom-setup.rb:
# ------------------------
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
# TB usage at which pricing changes
s3_tiers = %w{50 100 500 1000 5000 1000000000}.collect {|x| x.to_f}
# Cost per GB/month for each of the above tiers
s3 = %w{0.15 0.14 0.13 0.105 0.08 0.055}.collect {|x| x.to_f}
s3_reduced = %w{0.1 0.093 0.087 0.07 0.053 0.037}.collect {|x| x.to_f}
# ebs is always 0.10/GB per month
ebs = %w{0.1 0.1 0.1 0.1 0.1 0.1}.collect {|x| x.to_f}
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