Skip to content

Instantly share code, notes, and snippets.

View georgeu2000's full-sized avatar
💭
Status: Hood

George georgeu2000

💭
Status: Hood
View GitHub Profile
@ryanlecompte
ryanlecompte / gist:1283413
Created October 13, 2011 04:50
Providing an ActiveRecord-like before_filter capability to arbitrary Ruby classes
# First the end result of what we want:
class Foo
before_hook :whoa
before_hook :amazing
def test
puts "This is kinda cool!"
end
@bookis
bookis / backup_heroku_db.rake
Created February 20, 2011 02:56
Making a rake tasks to capture Heroku pgbackup and push to S3
namespace :backup do
desc "backup db from heroku and send to S3"
task :push_to_s3 => :environment do
Rake::Task[:environment].invoke
require 'aws/s3'
require 'heroku'
APP_NAME = 'luna-sandals' # put your app name here
BACKUP_BUCKET = "#{APP_NAME}-db-backups" # put your backup bucket name here
file_name = "backup-#{Time.now.strftime('%s')}.dump"