/^(\d[ -\.]?)?(\d{3}[ -\.]?)?\d{3}[ -\.]?\d{4}(x\d+)?$/
Ruby On Phone number regex
by halogenandtoast,
October 31, 2008 18:07
Event.find(:all, :conditions =>
"(strftime('%m%d', 'now') between strftime('%m%d', starts_at) and strftime('%m%d', ends_at)) or (strftime('%m%d', ends_at) <= strftime('%m%d', starts_at))")
Ruby On Yearly recurring event
by halogenandtoast,
October 30, 2008 19:45
This was a pain to figure o...
Ruby On Simplest way to find the na...
by halogenandtoast,
October 28, 2008 21:40
Unfortunately, no. You may ...
<?php
function array_to_tablerows($ary, $max) {
return empty($ary) ? null : "<tr>".implode("</tr><tr>", array_map(create_function('$a', 'return "<td>".implode("</td><td>", $a)."</td>".((count($a) % '.$max.' == 0) ? null : "<td colspan=\"".('.$max.' - count($a))."\"> </td>");'), array_chunk($ary, $max)))."</tr>";
...
<?php
function array_to_tablerows($ary, $max) { return array_create_table($ary, 0, $max); }
function array_create_table($ary, $idx, $max) {
...
class Person attr_reader :name, :children ...
Ruby On Person#children depth-first...
by halogenandtoast,
October 23, 2008 00:39
slightly less bulky, looks ...

Little less complex, same r...