def set_teams_members
    if params[:fee][:number_of_teams].blank? 
        number_of_teams = params[:teams]
...

Ruby On Need to remove If else

by mischamolhoek.myopenid.com, January 30, 2009 15:08

ternary cleans it up a bit

D7a31f22c11776898826f7c1ed0ff80a Talk
>> array_with_blank_strings.select{|n|n and n =~/\w/}
=>["Item 1", "Item 2", "Item 3"]

Ruby On Strip blank Strings and Nil...

by mischamolhoek.myopenid.com, January 13, 2009 14:42

or

D7a31f22c11776898826f7c1ed0ff80a Talk
def convert_from_textile_to_s5(fin)
    File.read('fin').scan(/h1\..[^\n]*\n(?:\*[^\n]*\n)*/m).map{|s| RedCloth.new(s).to_html}
end

Ruby On Converting Textile to S5

by mischamolhoek.myopenid.com, January 13, 2009 09:41 Star_full

i think this should do it...

D7a31f22c11776898826f7c1ed0ff80a Talk
puts Word.new('rdapepa epdemrtrfx,feyefryeemcprt,cn ct, zaaaxdam')

Ruby On Newb needs some cleanup

by mischamolhoek.myopenid.com, December 24, 2008 08:02

@adam - your right, it was ...

D7a31f22c11776898826f7c1ed0ff80a Talk
require 'enumerable'
brew = "rdadadroxmocpronogomocdmqzx"
brew = brew.split(//);
...

Ruby On Newb needs some cleanup

by mischamolhoek.myopenid.com, December 23, 2008 17:37

if you like oneliners.... :...

D7a31f22c11776898826f7c1ed0ff80a Talk

Ruby On very simple .srt resyncroniser

by mischamolhoek.myopenid.com, December 23, 2008 08:24

that's about as short as it...

D7a31f22c11776898826f7c1ed0ff80a Talk
category_id = category_name[/category-(\d+)/,1]

Ruby On Ugly RegEx Accessor

by mischamolhoek.myopenid.com, December 22, 2008 09:19

or do something like this

D7a31f22c11776898826f7c1ed0ff80a Talk

Ruby On Screen Scraping Google with...

by mischamolhoek.myopenid.com, December 18, 2008 08:52

just a question: why use wa...

D7a31f22c11776898826f7c1ed0ff80a Talk
row_sum = row[1..-1].inject(0){|s, e| s+e}

Ruby On Conditionally deleting colu...

by mischamolhoek.myopenid.com, December 18, 2008 08:35 Star_fullStar_fullStar_fullStar_full

for starters you can replac...

D7a31f22c11776898826f7c1ed0ff80a Talk
get '/:id.?:format?' do
 @vent = Vent.get(params[:id])
 builder :show if params[:format] == xml
...

Ruby On Trying to condence 2 method...

by mischamolhoek.myopenid.com, December 17, 2008 09:23

i would not use a case stat...

D7a31f22c11776898826f7c1ed0ff80a Talk