December 2010
3 posts
When a crab loses his shell, he finds one. When a man loses his shell, he...
– J. Scott Myers
Array#first and Array#last parameters
rubyquicktips:
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.
2 tags
This Would Be Less Hilarious If Both Were Human
leviathan: behemoth: er, in what is
behemoth: leviathan: in what is what?
leviathan: behemoth: we covered that.
behemoth: leviathan: no, we really didn't
leviathan: behemoth: sex for $15 dollars normal?
behemoth: leviathan: i'm afraid that i wouldn't know
leviathan: behemoth: time
behemoth: leviathan: yes, teim.
leviathan: behemoth: not
behemoth: leviathan: oh, you son of a bitch
leviathan: behemoth: time
behemoth: leviathan: okay, let's do this.
leviathan: behemoth: identify
behemoth: leviathan: fuck you, you know me
leviathan: behemoth: yay