Welcome To Snipplr


Everyone's Recent Snippets Tagged ruby



URI objects can be opened directly by open-uri
0 1711 posted 18 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 1506 posted 18 years ago by cczona
Beware of requiring 'CGI'. There's trouble in them thar hills/
1 1022 posted 18 years ago by cczona
1 1535 posted 18 years ago by wastepixel
2 1290 posted 18 years ago by sou
Very quick and dirty Pythagorean triples generator
1 1324 posted 18 years ago by lukaszkorecki
1 1194 posted 18 years ago by ctran
Returns the cartesian product of the receiver and the arrays given as arguments.
1 1776 posted 18 years ago by ishikawa
snippet from project.ioni.st - Marcel Molina (?)
3 2556 posted 18 years ago by tcol
Difficult to find in documentation but so easy
3 2928 posted 18 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 1451 posted 18 years ago by narkisr
1 1638 posted 18 years ago by vanne
1 1366 posted 18 years ago by vanne
0 1392 posted 18 years ago by vanne
Courtesy of Jesse.
2 2061 posted 18 years ago by ches
1 1421 posted 18 years ago by jhenry
https://www.chrisjmendez.com/2007/10/22/ruby-simple-example-of-threading/
3 3341 posted 18 years ago by chrisaiv
https://www.chrisjmendez.com/2007/10/21/ruby-how-to-iterate-through-an-array/
3 3192 posted 18 years ago by chrisaiv
https://www.chrisjmendez.com/2007/10/21/converting-an-array-into-yaml-loading-yaml-into-an-array/
1 3048 posted 18 years ago by chrisaiv
There are many functions available for Time, Month, Day, and Year. Below are a few examples I use frequently
1 1834 posted 18 years ago by chrisaiv