Skip to content

Instantly share code, notes, and snippets.

sudo tcpdump -i eth0 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# Run rake db:size to get a print of your database size in bytes.
# Run rake db:tables:size to get the sizes for individual tables
# Works for MySQL and PostgreSQL. Not tested elsewhere.
namespace :db do
desc 'Print data size for entire database'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
# How to setup multiple heroku accounts
# (assuming you already have one setup)
# make sure ~/bin is in your path
create ~/bin/hcred and populate it with the following:
1 #!/usr/bin/env ruby
2
3 `rm ~/.heroku/credentials`
@jrmehle
jrmehle / yuicompressor.sh
Created March 20, 2009 21:58
Ruby shell script wrapper around YUI compressor.
#!/usr/bin/env ruby
file_to_minify = ARGV.first
system "java -jar /Users/jaredmehle/Documents/workspace/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar #{file_to_minify} -o #{file_to_minify.split('.').first}-min.js"