Skip to content

Instantly share code, notes, and snippets.

<div class="left-main">
<p class="original-site">RECENT DESIGNS</p>
<% @articles.each.with_index do |article, i| %>
<% if i % 4 == 0 %>
<%= link_to(image_tag(article.main_image_url.to_s), article, {:class => 'dock-item'}) %>
<% else %>
<%= link_to(image_tag(article.main_image_url.to_s), article, {:class => 'dock-item2'}) %>
<% end %>
<% end %>
</div>
require 'test/unit/assertions'
include Test::Unit::Assertions
assert_equal "1.9.2", RUBY_VERSION
# A Ruby meta-programming puzzle for polite programmers.
# This puzzle was created by Matt Wynne (@mattwynne) on 2011-04-10 inspired by Jim Weirich's
# talk at the Scottish Ruby Conference 2011.
#
# The challenge is: you have a class Foo which you want to monkey-patch, but politely.
<% clients = @clients.select { |c| c.clientID == 2 } %>
<%= clients.map(&:clientID) %>