1
rows_in_order = side == :white ? (0..7) : (0..7).to_a.reverse

Ruby On Easy - descending range

by mvanholstyn, August 01, 2008 04:17 Star_fullStar_fullStar_fullStar_full
F9ac05fdd57915983ccea58699e1f942 Talk
1
2
3
4
def date(date, time = false)
    date = Date.parse(date) if date.class.is_a? String
    format = time ? "%B #{date.day}, %Y at #{date.strftime('%I').to_i}:%M %p" : "%B #{date.day}, %Y"
...

Ruby On Human Date Method

by mvanholstyn, July 05, 2008 15:57 Star_fullStar_fullStar_fullStar_full
F9ac05fdd57915983ccea58699e1f942 Talk
1
2
3
def highlight_text(input, words_to_highlight = [], wrapper = '*\1*')
  input.gsub(/\b(#{words_to_highlight.join("|")})\b/, wrapper)
end

Ruby On Rubyize this : 5th edition

by mvanholstyn, January 03, 2008 14:33
F9ac05fdd57915983ccea58699e1f942 Talk

Ruby On Simple Text Replacement

by mvanholstyn, November 16, 2007 04:30

bilson -- that code is runn...

F9ac05fdd57915983ccea58699e1f942 Talk
1
2
3
4
def replace_keywords(keyword_hash, text_to_parse)
  text_to_parse.gsub(/\{(.*?)\}/) do |match|
    keyword_hash[$1] || match
...

Ruby On Simple Text Replacement

by mvanholstyn, November 16, 2007 02:50 Star_fullStar_fullStar_fullStar_full
F9ac05fdd57915983ccea58699e1f942 Talk