class Array
  def split_in_two(first_chunk_size = self.size / 2)
   [self[0..first_chunk_size - 1], self[first_chunk_size..-1]]
...

Ruby On Split an array into half

by dcadenas.blogspot.com, October 02, 2010 15:07

If you are going to use thi...

Acad2552784135c09b17c00853f5a6f8 Talk

Ruby On Code to detect the web browser

by dcadenas.blogspot.com, August 29, 2008 17:19

@foca: A method extraction ...

Acad2552784135c09b17c00853f5a6f8 Talk
require 'rubygems'
require 'spec' 

...

Ruby On Code to detect the web browser

by dcadenas.blogspot.com, August 29, 2008 02:10

@chrismo: check that your c...

Acad2552784135c09b17c00853f5a6f8 Talk
def test_web_browser()
  if request.env["HTTP_USER_AGENT"][/Firefox\/3/]=="Firefox/3"
    return "Firefox3"
...

Ruby Code to detect the web browser

by dcadenas.blogspot.com, August 28, 2008 17:19, 18 refactorings

This is not my code but I w...

Acad2552784135c09b17c00853f5a6f8 Talk
static class ExtensionsMethods
    {
        public static bool IsMultipleOf(this int number, int num)
...

C# On I hate to do this, but...

by dcadenas.blogspot.com, July 16, 2008 02:04 Star_fullStar_fullStar_fullStar_full
Acad2552784135c09b17c00853f5a6f8 Talk
def human_date date
  date = Date.parse(date) if date.is_a?(String)
  date.strftime date_format(date)
...

Ruby On Human Date Method

by dcadenas.blogspot.com, July 06, 2008 10:12 Star_fullStar_fullStar_fullStar_full

I share the scudco point of...

Acad2552784135c09b17c00853f5a6f8 Talk