Skip to content

Instantly share code, notes, and snippets.

@rtwomey
rtwomey / keybase.md
Last active August 29, 2015 14:08
keybase.md

Keybase proof

I hereby claim:

  • I am rtwomey on github.
  • I am rtwomey (https://keybase.io/rtwomey) on keybase.
  • I have a public key whose fingerprint is 04F5 FC32 5814 2367 C817 CCA8 ACD7 2404 CBFC 7B49

To claim this, I am signing this object:

@rtwomey
rtwomey / gist:5555873
Created May 10, 2013 17:16
Friday Dev Discussion, May 10 201
Agenda
Overview
* be sure to think of something you learned this week that you'd like to
share
* Discuss three gems:
## bullet (https://github.com/flyerhzm/bullet)
# Gemfile
curl -I http://www.rubygems.org
HTTP/1.1 200 OK
Server: nginx/1.2.2
Date: Tue, 07 Aug 2012 19:41:31 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
X-UA-Compatible: IE=Edge,chrome=1
@rtwomey
rtwomey / gist:3209869
Created July 30, 2012 20:24
Print SQL from your ruby tests
Helpful debugging trick:
When running a focused test, sometimes it's useful to log the SQL generated by the test. Stick the following in your test:
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)
Rerun your focused test and bask in the loveliness that is your test's SQL.
@rtwomey
rtwomey / Heroku DB Migration.mdown
Created July 23, 2012 18:47
How to migrate a DB on heroku to another plan

Recently, I had a staging database on Heroku that was running on the Ronin database (which was originally the lowest-sized DB you could get at Heroku). Since they added two new options, Crane and Kappa, we wanted to take advantage of the cost savings. Here's how you can migrate your Ronin DB to Crane (or any other plan).

The old database was named BROWN while the new one is CRIMSON. You can determine this by running:

heroku pg:info --app myapp-staging
  1. Add Crane database

     heroku addons:add heroku-postgresql:crane --app myapp-staging
    

heroku pg:wait --app myapp-staging