Skip to content

Instantly share code, notes, and snippets.

View davidfrey's full-sized avatar

David Frey davidfrey

View GitHub Profile
@davidfrey
davidfrey / Ruby Checklist
Last active December 17, 2015 06:59
Brief checklist for setting up a new Mac (Mountain Lion) for ruby development
# Setting up Ruby development environment for a new Mac
Install Xcode from the App store.
Install Command Line Tools from XCode
Install Homebrew
Run `brew doctor` at each stage of an install
You may have to reorder the path priority in /etc/paths
Install Git
`brew install git`
Configure Git
`config --global user.name "Your Name"`
@davidfrey
davidfrey / rescue.rb
Created April 5, 2012 22:45
Twitter::Error::ServiceUnavailable
attempt_count = 0
begin
response = Twitter.user_timeline('davidfrey', {:count=>200, :include_rts => true, :include_entitites => true})
rescue Twitter::Error => error
attempts_count += 1
code = error.class.to_s.gsub('Twitter::Error::','')
case code.downcase
when /notfound|unauthorized/
#void collection
@davidfrey
davidfrey / doorkeeper-provider.log
Created February 27, 2012 23:19
The redirect uri included is not valid.
Started GET "/oauth/authorize?response_type=code&client_id=197ed256c231df835220264639dc4122a1f08a5806ac49d8558bca5a4559908f&redirect_uri=http%3A%2F%2Fdoorkeeper-client.dev%2Fusers%2Fauth%2Fdoorkeeper%2Fcallback" for 127.0.0.1 at 2012-02-27 15:18:29 -0800
Processing by Doorkeeper::AuthorizationsController#new as HTML
Parameters: {"response_type"=>"code", "client_id"=>"197ed256c231df835220264639dc4122a1f08a5806ac49d8558bca5a4559908f", "redirect_uri"=>"http://doorkeeper-client.dev/users/auth/doorkeeper/callback"}
Admin Load (0.2ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = 1 LIMIT 1
Doorkeeper::Application Load (0.2ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = '197ed256c231df835220264639dc4122a1f08a5806ac49d8558bca5a4559908f' LIMIT 1
Rendered doorkeeper/authorizations/error.html.erb within layouts/application (9.5ms)
Completed 200 OK in 140ms (Views: 70.0ms | ActiveRecord: 0.6ms)