Welcome To Snipplr


Everyone's Recent Ruby Snippets



Quick conversion from a string of binary into ascii, and back again.\r\nUse B* for MSB and b* for LSB first.
0 493 posted 12 years ago by jimbobmcfred
0 339 posted 12 years ago by rkumar
I’ve recently had to parse some pretty large XML documents, and needed a method to read one element at a time. Here’s a fairly simple solution in Ruby form.
0 517 posted 12 years ago by dom111
0 305 posted 12 years ago by rkumar
0 331 posted 12 years ago by rkumar
0 321 posted 12 years ago by rkumar
0 450 posted 12 years ago by viatropos
0 374 posted 12 years ago by therobot
0 422 posted 12 years ago by viatropos
0 403 posted 12 years ago by pdxmph
Easy way to populate a drop-down menu
3 621 posted 12 years ago by chrisaiv
validate :price_must_be_at_least_a_cent protected def price_must_be_at_least_a_cent errors.add(:price, 'should be at least 0.01') if price.nil? || price < 0.01 end
0 396 posted 12 years ago by stayce
This Ruby script generates the [Gnome Terminals For Rails script](http://snipplr.com/view/32227/gnome-terminals-for-rails/ "Gnome Terminals For Rails").
0 298 posted 12 years ago by draq
0 443 posted 12 years ago by inkdeep
0 671 posted 12 years ago by inkdeep
0 335 posted 12 years ago by inkdeep