Created
November 14, 2012 02:32
-
-
Save nbashaw/4069915 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hotness = age_in_minutes / (votes**2.5) | |
age_in_minutes = (((link.created_at.to_f / 60).floor * 60) - ((Time.now.to_f / 60).floor * 60)) / -60 | |
hotness = age_in_minutes / (link.votes**2.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're doing Time#to_f#floor, isn't that the same as Time#to_i, which is the number of seconds?
In that case, you can say: