Skip to content

Instantly share code, notes, and snippets.

simple:~ jonathanwallace$ irb
[1] pry(main)> hello = nil
=> nil
[2] pry(main)> def hello
[2] pry(main)* puts 'ehloo'
[2] pry(main)* end
=> nil
[3] pry(main)> hello
=> nil
[4] pry(main)> hello()
simple:puppet-weechat jonathanwallace$ ./script/cibuild
Using rake (10.1.0)
Using addressable (2.3.5)
Using ansi (1.4.3)
Using json_pure (1.8.0)
Using hiera (1.2.1)
Using highline (1.6.19)
Using json (1.8.0)
Using thor (0.18.1)
Using librarian-puppet (0.9.9)
@wallace
wallace / gist:6127633
Last active December 20, 2015 11:59 — forked from jeremiaheb/gist:6124581
class StationLog < ActiveRecord::Base
belongs_to :boat_log
has_many :rep_logs, :dependent => :destroy
accepts_nested_attributes_for :rep_logs, :reject_if => lambda { |a| a[:replicate].blank? }, :allow_destroy => true
EARTH_RADIUS = 6371000 # Earth's radius in meters
# convert degrees to radians
def self.convDegRad(value)
# rename the extracted dump files to be in your local database name
$ mv dump/exported_database_name/ dump/my_local_database_name
# restore using the appropriate port. assume that foreman is started and running
$ mongorestore dump --port 28018
def group_length(tier_level)
return "" if tier_level.blank?
@group_instance_variable[tier_level].length
end
There was a ArgumentError while loading debugger.gemspec:
Illformed requirement [{:git=>"https://github.com/tmm1/pygments.rb.git"}] from
/Users/jonathanwallace/Documents/projects/debugger/debugger.gemspec:23:in `block in <main>'
Vector3 floorNormal = new Vector3(0.0f,1.0f, 0.0f);
foreach(ContactPoint currentPoint in collision.contacts) {
if (currentPoint.normal.y != floorNormal.y) {
IsOnGround = false;
}
}
@wallace
wallace / gist:5371897
Created April 12, 2013 13:12
failure building ruby 2.0 on my mac book pro
[2013-04-12 09:11:05] make
CC = /usr/local/bin/gcc-4.2
LD = ld
LDSHARED = /usr/local/bin/gcc-4.2 -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I. -I.ext/include/x86_64-darwin12.3.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,sup
@wallace
wallace / error
Last active December 14, 2015 10:29
Override a Rails attr_accessor method with a method that expects an argument and watch it fail.
temp.rb:19:in `title': wrong number of arguments (0 for 1) (ArgumentError)
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:143:in `attribute_change'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `block in changes'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `map'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `changes'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:34:in `block in save!'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:33:in `tap'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
from /Users/jonathanw
@wallace
wallace / urlgrab.conf
Created February 14, 2013 01:27
Example urlgrab.conf configuration for weechat.
#
# urlgrab.conf -- weechat v0.3.9.2
#
[color]
color_bg_selected = green
color_buffer = red
color_buffer_selected = red
color_time = cyan
color_time_selected = cyan