Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
Last active August 29, 2015 14:01
Show Gist options
  • Save kentcdodds/2d8271cdf2d4b976966e to your computer and use it in GitHub Desktop.
Save kentcdodds/2d8271cdf2d4b976966e to your computer and use it in GitHub Desktop.
Sort the papers for Utah JS by vote
// 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