Welcome To Snipplr


Everyone's Recent Ruby Snippets



"When using haml, an HTML tag is represented using %tagname, but in the case of an HTML tag with attributes, the representation is %tagname{:attribute => value}. It turns out there must be no whitespace between %tagname and {:attribute => value}....
1 317 posted 13 years ago by cczona
See also p. 348 ("Invoking a Method") of Pickaxe 2nd edition
1 347 posted 13 years ago by cczona
Following a
2 337 posted 13 years ago by cczona
This is handy for testing, when you need to simulate an open file or open URI. Why, and the Pickaxe book, have better examples
1 350 posted 13 years ago by cczona
You can turn off warnings for a section of your code by setting $VERBOSE to nil. Even better is to codify this in a method. Since this method takes a block as its parameter, you can now pass it arbitrary chunks of code to execute without warnings.
1 342 posted 13 years ago by cczona
Beware of requiring 'CGI'. There's trouble in them thar hills/
1 196 posted 13 years ago by cczona
1 309 posted 13 years ago by wastepixel
output can be run as a shell script. should be able to refactor this as a piped wget, i think
1 355 posted 13 years ago by jhenry
2 252 posted 13 years ago by sou
Very quick and dirty Pythagorean triples generator
1 270 posted 13 years ago by lukaszkorecki
1 272 posted 13 years ago by ctran
Creates a SSL connection with delicious API using the HTTP basic authentication.
4 383 posted 13 years ago by pmd
Returns the cartesian product of the receiver and the arrays given as arguments.
1 372 posted 13 years ago by ishikawa
Originally written by Erik Kastner (@kastner).
1 338 posted 13 years ago by jrphelps
snippet from project.ioni.st - Marcel Molina (?)
3 343 posted 13 years ago by tcol
Difficult to find in documentation but so easy
3 444 posted 13 years ago by arnoldu
This script will setup JBoss 4.2.2 to use null persistence (no DB, see http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQNullPersistence) when handling JMS messages.
1 324 posted 14 years ago by narkisr
1 318 posted 14 years ago by vanne
1 264 posted 14 years ago by vanne