Skip to content

Instantly share code, notes, and snippets.

View rsim's full-sized avatar

Raimonds Simanovskis rsim

View GitHub Profile
@rsim
rsim / speaker.md
Created July 1, 2012 15:44 — forked from matiaskorhonen/speaker.md
Frozen Rails Talk Proposal Template (http://2012.frozenrails.eu/)
def rank(arr)
count = {}
arr.each{|item| count[item] = (count[item]||0) + 1}
rank = 1 # initial ranking
ranking = {}
count.keys.sort.reverse.each{|item| ranking[item] = rank; rank += count[item]}
arr.map{|item| ranking[item]}
end