Skip to content

Instantly share code, notes, and snippets.

View mghaught's full-sized avatar

Marty Haught mghaught

View GitHub Profile
[Mon, 02 Aug 2010 11:04:21 -0600] INFO: Installing homebrew[kiwi] version 0.3.1
[Mon, 02 Aug 2010 11:04:59 -0600] INFO: Creating file[/Users/marty/Developer/bin/npm] at /Users/marty/Developer/bin/npm
[Mon, 02 Aug 2010 11:04:59 -0600] INFO: Setting owner to 501 for file[/Users/marty/Developer/bin/npm]
[Mon, 02 Aug 2010 11:04:59 -0600] INFO: Setting group to 20 for file[/Users/marty/Developer/bin/npm]
[Mon, 02 Aug 2010 11:04:59 -0600] ERROR: file[/Users/marty/Developer/bin/npm] (/Users/marty/.cider/cookbooks/node/recipes/default.rb:19:in `from_file') had an error:
Operation not permitted - /Users/marty/Developer/bin/npm
/Library/Ruby/Gems/1.8/gems/chef-0.9.6/bin/../lib/chef/provider/file.rb:116:in `chown'
/Library/Ruby/Gems/1.8/gems/chef-0.9.6/bin/../lib/chef/provider/file.rb:116:in `set_group'
/Library/Ruby/Gems/1.8/gems/chef-0.9.6/bin/../lib/chef/provider/file.rb:147:in `action_create'
/Library/Ruby/Gems/1.8/gems/chef-0.9.6/bin/../lib/chef/runner.rb:50:in `send'
@mghaught
mghaught / gist:744501
Created December 17, 2010 04:47
Heroku env json error
Error Message:
JSON::ParserError: A JSON text must at least contain two octets!
Where:
[GEM_ROOT]/gems/json-1.4.6/lib/json/common.rb, line 146
Backtrace Summary:
@mghaught
mghaught / gist:767189
Created January 5, 2011 23:00
h13 errors
2011-01-05T14:56:51-08:00 app[web.2]: ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02
2011-01-05T14:56:51-08:00 heroku[router]: Error H13 (Connection closed without response) -> GET richarddawkins.net/ dyno=web.2 queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:56:51-08:00 heroku[router]: Error H13 (Connection closed without response) -> GET richarddawkins.net/javascripts/jquery.cycle.min.js dyno=web.2 queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:56:51-08:00 heroku[router]: Error H13 (Connection closed without response) -> GET richarddawkins.net/for_user.js dyno=web.2 queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:56:51-08:00 heroku[router]: Error H13 (Connection closed without response) -> GET richarddawkins.net/feed.php dyno=web.2 queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:56:51-08:00 heroku[router]: Error H13 (Connection closed without response) -> GET richarddawkins.net/comments/486078 dyno=web.2 queue=0 wait=0ms service=0ms bytes=0
@mghaught
mghaught / gist:767191
Created January 5, 2011 23:01
H10 errors
2011-01-05T14:55:54-08:00 heroku[nginx]: GET /articles/571949-pakistanis-rally-in-support-of-blasphemy-law HTTP/1.1 | 207.46.13.51 | 3309 | http | 500
2011-01-05T14:55:54-08:00 heroku[router]: Error H10 (App crashed) -> GET richarddawkins.net/comments/571657 dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:55:54-08:00 heroku[nginx]: GET /comments/571657 HTTP/1.1 | 207.46.204.184 | 3308 | http | 500
2011-01-05T14:55:54-08:00 heroku[router]: Error H10 (App crashed) -> GET richarddawkins.net/comments/567962 dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:55:54-08:00 heroku[nginx]: GET /comments/567962 HTTP/1.0 | 207.46.13.51 | 3309 | http | 500
2011-01-05T14:55:54-08:00 heroku[router]: Error H10 (App crashed) -> GET richarddawkins.net/comments/570195 dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-01-05T14:55:54-08:00 heroku[nginx]: GET /comments/570195 HTTP/1.1 | 207.46.204.184 | 3308 | http | 500
2011-01-05T14:55:54-08:00 heroku[nginx]: GET /images/bars/alt/right/news1.jpg?12942654
@mghaught
mghaught / gist:811524
Created February 4, 2011 18:38
database_cleaner backtrace
DOH!!! error - undefined method `query_options' for nil:NilClass
["/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/activesupport-3.0.3/lib/active_support/whiny_nil.rb:48:in `method_missing'", "/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:310:in `execute'", "/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:269:in `update_sql'", "/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:331:in `update_sql'", "/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update'", "/Users/marty/Developer/.rvm/gems/ruby-1.9.2-p136@tnation/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:16:in `update'", "/Users/
@mghaught
mghaught / gist:811933
Created February 4, 2011 22:46
database_cleaner - mysql2 oddity with second connection
Truncation performed on main DB:
mysql2 - disable_referential_integrity - 1
>> mysql2 - active? true
SQL (0.1ms) SET FOREIGN_KEY_CHECKS = 0
>> disabled referential integrity
SQL (0.4ms) SHOW TABLES
SQL (0.1ms) SELECT DATABASE() as db
SQL (0.7ms) select table_name from information_schema.views where table_schema = 'tnation_forums_test'
>> truncating categories
@mghaught
mghaught / sinatra_app.rb
Created March 18, 2011 16:39
nps sinatra app
require 'rubygems'
require 'sinatra/base'
require 'haml'
class NetPromoterScoreApp < Sinatra::Base
before do
headers "Content-Type" => "text/html; charset=utf-8"
end
MartyMPBS-3:outcampaign.org marty$ heroku addons --app outcampaign
bundles:single
custom_domains:basic
exceptional:basic
newrelic:bronze
pgbackups:daily
shared-database:5mb
ssl:piggyback
MartyMPBS-3:outcampaign.org marty$ heroku plugins:install git://github.com/nzoschke/pgbackups-automate.git
pgbackups-automate installed
@mghaught
mghaught / state_machine_model.rb
Created May 5, 2011 15:12
state_machine setup
state_machine :checkout_state, :initial => :address, :use_transactions => false do
state :delivery
state :payment
state :confirm
state :complete
event :next do
transition :from => 'address', :to => 'delivery'
transition :from => 'delivery', :to => 'payment'
transition :from => 'payment', :to => 'confirm'
class Project
include Ripple::Document
property :name, String, :presence => true
property :survey_text, String, :presence => true
property :follow_up_text, String
many :scores