Did you know you can pass a number parameter to Array#first and Array#last?
x = [1,2,3,4,5,6,7,8,9,10]
x.first 5
=> [1,2,3,4,5]
x.last 2
=> [9,10]
This tip was submitted by Alfred Nagy.
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.