Skip to content

Instantly share code, notes, and snippets.

View renato-zannon's full-sized avatar

Renato Zannon renato-zannon

View GitHub Profile
@renato-zannon
renato-zannon / named_dynamic_methods.rb
Created September 20, 2011 13:53
A simple practice to help your fellow workers navigate your dynamic ruby code
# It's common, while creating a bunch of very similar methods, to create
# a loop to define them all at once. (Very simple) example follows:
week_days = %w[sunday monday tuesday wednesday thursday friday saturday]
week_days.each do |day|
define_method("events_on_#{day}") do
events.select { |event| event.day == day }
end
end

Keybase proof

I hereby claim:

  • I am renato-zannon on github.
  • I am renato_zannon (https://keybase.io/renato_zannon) on keybase.
  • I have a public key whose fingerprint is 723E BFA3 0EBE 26C6 4310 5364 6C26 8AF6 75E7 D62E

To claim this, I am signing this object:

@renato-zannon
renato-zannon / results
Created June 5, 2014 22:11
Rust: Semaphores vs channels
running 2 tests
test with_channels ... bench: 876410 ns/iter (+/- 655463)
test with_semaphores ... bench: 513476 ns/iter (+/- 711503)
test result: ok. 0 passed; 0 failed; 0 ignored; 2 measured