pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]}

pools.inject([]) {|m,x| m << x[1].select {|y| pools[x[0] + 1].include?(y) unless pools[x[0] + 1].nil?}}.flatten
...

Ruby On Find the Intersection of Ar...

by rjspotter, August 06, 2008 22:01

I'm basicly golfing at this...

D8daae35e495689a5f17d86f15d18eb4 Talk

Ruby On Array#split_with(something)

by rjspotter, August 06, 2008 19:54

Yeah like that. *head-desk*

D8daae35e495689a5f17d86f15d18eb4 Talk
<style type="text/css">
  a.go_back { background: url(/images/go_back.png) center left no-repeat; padding-left: /*width of go_back.png*/;}
</style>
...

Ruby On link_to with an image_tag a...

by rjspotter, August 06, 2008 19:45

alternate suggestion

D8daae35e495689a5f17d86f15d18eb4 Talk
<%= link_to "#{image_tag("go_back.png")}Go Back", user_path(@user) %>

Ruby On link_to with an image_tag a...

by rjspotter, August 06, 2008 19:31 Star_fullStar_fullStar_fullStar_fullStar_full
D8daae35e495689a5f17d86f15d18eb4 Talk
require 'rubygems'
require 'functor'

...

Ruby Array#split_with(something)

by rjspotter, August 06, 2008 19:07, 2 refactorings

This started out as "wouldn...

D8daae35e495689a5f17d86f15d18eb4 Talk