Skip to content

Instantly share code, notes, and snippets.

==> actionmailer/CHANGELOG <==
## Rails 3.0.18
## Rails 3.0.17 (Aug 9, 2012)
* No changes.
## Rails 3.0.16 (Jul 26, 2012)
* No changes.
@ack
ack / rdbg
Created August 7, 2012 19:28
gdb-ruby
apt-get install -qqy gdb
cat > ~/.gdbinit <<EOF
define eval
call(rb_p(rb_eval_string_protect(\$arg0,(int*)0)))
end
define redirect_stdout
call rb_eval_string("\$_old_stdout, \$stdout = \$stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); \$stdout.sync = true")
@ack
ack / README.md
Created June 25, 2012 16:56
vcap hm leak

PATCH

cloud_controller/app/models/app.rb
   def set_defaults
-    self.metadata ||= {}
+    self.metadata = {} if new_record?
   end

VERSIONS:

  • ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
# yield chunks (Array) of the full query to a block
# generates new Collections via self.model.all
# which has the advantage of dropping scope on
# hydrated objects
def block_batches(chunksize, &block)
new_options = self.query.options.dup
total = new_options[:limit] || self.count
new_options[:limit] = chunksize
new_options[:offset] = 0