Skip to content

Instantly share code, notes, and snippets.

@ryane
ryane / gist:1877545
Created February 21, 2012 17:26
Rake task to restore the latest backup from heroku into your local development postgres database
# quick and dirty postgres database restoration from heroku
# This works in my local dev environment
# It might not work in yours without some changes
# Now just uses Heroku::Auth to get an authenticated client. No
# need to read a credentials file. You probably need a recent
# version of the heroku gem for this to work
desc "Restore from heroku"
task :restore do
require 'pgbackups/client'
@ryane
ryane / focus.rb
Created January 23, 2012 19:37
(un)Block distracting sites in hosts file via quick and dirty script. Inspired by http://al3x.net/2009/09/14/my-get-back-to-work-hack.html
#!/usr/bin/env ruby
## you will probably need to run this via sudo
## sudo ruby focus.rb [on|off]
# inspired by http://al3x.net/2009/09/14/my-get-back-to-work-hack.html
require 'fileutils'
require 'tempfile'