Last active
August 29, 2015 14:01
-
-
Save kentcdodds/2d8271cdf2d4b976966e to your computer and use it in GitHub Desktop.
Sort the papers for Utah JS by vote
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
// Paste this into the console on http://conf.utahjs.com/vote | |
(function() { | |
var tableBody = $('tbody'); | |
$('.score').map(function(index, score) { | |
return { | |
el: $(score).parents('tr'), | |
score: ~~score.innerText | |
}; | |
}).sort(function(a, b) { | |
return a.score < b.score ? 1 : a.score > b.score ? -1 : 0; | |
}).each(function() { | |
this.el.remove(); | |
tableBody.append(this.el); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment