# If you were doing something like this in your code: session[:orientation] = setOrDefault ...
Ruby On default value if not define...
by Muke Tever,
July 16, 2010 22:57
Number.find(:all, ...
Ruby On Ruby - Chained collect stat...
by Muke Tever,
October 24, 2009 03:45
I had a lot of these in my ...
@total_pages = total.quo(per_page).ceil
Ruby On Pagination total page count
by Muke Tever,
October 07, 2009 06:41
And no need to convert tota...
def bold_around_pipes (str)
stack, functional = 0, false
"'''#{str}'''".each_char.inject('') do |memo, char|
...
name = "female" if name =~ /male/ ...
Ruby On ungliness and long too
by Muke Tever,
September 11, 2009 06:00
Not a refactoring (the abov...
birthinfo = "<p class='birthinfo'>%s %s %s %s</p>" % [name,
if birthdate.present? || location.present? then "was born %s%s%s." % [
("on %s" % birthdate.strftime("%A, %B %e, %Y") unless birthdate.blank?),
...
Ruby On Massive if/elsif statement ...
by Muke Tever,
September 06, 2009 03:45
I discovered a new hammer t...
xx = case string[/1/] || host[/(a|fd|na|op)/]
when '1' then 1
when 'a' then "fd"
...
Ruby On Case statement with Regular...
by Muke Tever,
August 21, 2009 15:14
And here's the same thing w...
xx = string.include?("1") ? 1 :
case host[/(a|fd|na|op)/]
when 'a' then "fd"
...
Ruby On Case statement with Regular...
by Muke Tever,
August 21, 2009 00:37
Tried to make it look nicer...
Ruby On dual object creating in Rails
by Muke Tever,
August 03, 2009 18:02
Old book, eh? Have you loo...
def unbold_pipes (wikibold_string)
wikibold_string.
split('|').
...
Ruby Ugly split/join
This is supposed to be taki...
Ruby On Massive if/elsif statement ...
by Muke Tever,
July 30, 2009 15:25
I seem to have thrown a str...
# first sentence
birthinfo = "<p class='birthinfo'>#{name} "
if birthdate.present? || location.present? {
...
Ruby On Massive if/elsif statement ...
by Muke Tever,
July 30, 2009 15:23
I tried to take it apart a ...

Depending on how you were u...