Ruby On Including modules degradably
by macournoyer,
February 13, 2008 02:05
Seems like there was a cach...
Ruby On Rubyize this : 5th edition
by macournoyer,
January 03, 2008 14:41
Sorry about the form not wo...
1 2 3 4
def highlight_text(input, words_to_highlight=%w(important monkey dancing)) input.gsub(/#{words_to_highlight.join('|')}/i, '*\0*') end ...
Ruby On Rubyize this : 5th edition
by macournoyer,
January 03, 2008 14:26
Here's my take, it's short ...
JavaScript On Amélioration d'une fonction JS
by macournoyer,
December 01, 2007 20:27
Sorry Eineki about the prob...
Ruby On managable test method
by macournoyer,
November 23, 2007 15:15
might be easier for you to ...
Ruby On managable test method
by macournoyer,
November 22, 2007 18:41
You should give a look at R...
Ruby On Random number generator
by macournoyer,
November 19, 2007 19:57
Here's a fun intro to Ruby ...
Ruby On Random number generator
by macournoyer,
November 19, 2007 18:09
sorry I forgot to put the p...
1
ruby -e "puts (1..500).map {rand(10 ** 16).to_s.rjust(16,'0')}"
Ruby On Random number generator
by macournoyer,
November 19, 2007 15:14
You can open an interactive...
1
<%= [@post.category.name if @post.category, link_to(@post.title, post_path(@post))].compact.join(' : ') %>
1
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>
Ruby Handling nil object
@post.category can be nil, ...
1 2 3
class PostsController < ApplicationController ...
Ruby On resource_controller: Redesi...
by macournoyer,
November 05, 2007 22:24
A couple of suggestions. I'...
1 2 3 4
class String def postal? self =~ /[a-z]\d[a-z]([\s-])*\d[a-z]\d/i ...
Ruby On Is This String Postal?
by macournoyer,
October 30, 2007 15:53
I think {1} are useless, we...
1 2 3 4
class String def to_proc eval "proc { |s| s#{self} }" ...
Ruby On String#to_proc (by Reginald...
by macournoyer,
October 30, 2007 14:24
I refactored it for the sim...
1 2 3 4
namespace :db do namespace :migrate do desc 'Reverts, renames and re-executes uncommitted migrations that conflict with already committed migrations' ...
Ruby On Rails migration conflict re...
by macournoyer,
October 29, 2007 20:57
This is the most useful rak...
JavaScript On ImageFlow - something like ...
by macournoyer,
October 25, 2007 15:49
WOW! that's some nice effec...
1 2 3 4
class Bug < Struct.new(:name, :type, :iq, :annoyance_factor); end #create some bugs! ...
Ruby On Rubyize this : 4th edition
by macournoyer,
October 23, 2007 13:50
Here's my take. Bug as no l...

hey Rob, why not post some ...