Skip to content

Instantly share code, notes, and snippets.

View ybakos's full-sized avatar
💭
the machine stops the machine stops the machine stops

Yong Joseph Bakos ybakos

💭
the machine stops the machine stops the machine stops
View GitHub Profile
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
/usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:1006:in `id_from_response'
/usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:993:in `create'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:992:in `create'
/usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:793:in `save_without_validation'
/usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/validations.rb:248:in `save'
>> u.core_user.reload
ArgumentError: expected an attributes Hash, got #<Sgcore::User::Group:0x5402838 @prefix_options={}, @attributes={"name"=>"Sent Invite", "group_type_id"=>nil, "updated_at"=>Thu Feb 19 18:31:39 UTC 2009, "id"=>23, "group_id"=>"23", "user_id"=>"11", "created_at"=>Thu Feb 19 18:31:39 UTC 2009}>
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:939:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:653:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:946:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:946:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:946:in `map'
from /usr/local/lib/ruby/gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:946:in `load'
from /usr/local/lib/ruby/gems/
# svn export
git checkout-index -a -f --prefix=/destination/path/
# merge pdfs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=assignment06.pdf pt1.pdf pt2.pdf
require 'benchmark'
n = 100000
Benchmark.bm do |x|
x.report('copy') { n.times do ; h = {}; h = h.merge({1 => 2}); end }
x.report('no copy') { n.times do ; h = {}; h.merge!({1 => 2}); end }
x.report('aha') { n.times do; puts 'your shit here'; end }
end
fg -hl (to get dev name)
sudo fsck_hfs -l /dev/DEV_NAME
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain system local user
sudo fs_usage -f filesys
cat /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/CoreServices/SystemVersion.plist
su - postgres
cd /usr/local/pgsql/bin
./postmaster -D /usr/local/pgsql/data &