Skip to content

Instantly share code, notes, and snippets.

@justinweiss
justinweiss / settings.rb
Created May 27, 2014 16:54
Simple settings for Rails
require 'yaml'
require 'erb'
require 'ostruct'
class Settings < OpenStruct
# Settings.new(:google_analytics)
def initialize(config_file_base_name)
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env])
end
@wrburgess
wrburgess / gist:3752973
Created September 19, 2012 23:17
Setting up Redis/Resque with Rails 3 on Local and Heroku
@kagemusha
kagemusha / gist:1569836
Created January 6, 2012 09:20
Dump Heroku Postgres DB and load locally
Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump