Skip to content

Instantly share code, notes, and snippets.

@mzabriskie
Created May 20, 2014 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzabriskie/b08a2a444b806f746326 to your computer and use it in GitHub Desktop.
Save mzabriskie/b08a2a444b806f746326 to your computer and use it in GitHub Desktop.
Sort voting results for UtahJS Conf - http://conf.utahjs.com/vote
[].slice.call(document.querySelectorAll('tr.paper')).sort(function (a, b) {
a = parseInt(a.querySelector('td:first-of-type span.score').innerHTML);
b = parseInt(b.querySelector('td:first-of-type span.score').innerHTML);
return a > b ? -1 : b > a ? 1 : 0;
}).forEach(function (node) {
node.parentNode.appendChild(node);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment