Skip to content

Instantly share code, notes, and snippets.

@ivanpepelko
Created June 16, 2015 23:45
Show Gist options
  • Save ivanpepelko/aa587a69bbbe5f2cc90b to your computer and use it in GitHub Desktop.
Save ivanpepelko/aa587a69bbbe5f2cc90b to your computer and use it in GitHub Desktop.
Dotabuff heroes sorting minified
(function(){$(".tableAd").remove();var t=parseInt($(".game-record .wins").text().replace(",",""))+parseInt($(".game-record .losses").text().replace(",",""))+parseInt($(".game-record .abandons").text().replace(",",""));console.log(t),parseFloat($("table tbody tr").eq(0).find("td").eq(4).text());var e=$("table tbody tr").sort(function(e,a){var r=parseInt($(e).find("td").eq(2).text()),d=parseFloat($(e).find("td").eq(3).text()),n=parseFloat($(e).find("td").eq(4).text()),o=parseInt($(a).find("td").eq(2).text()),s=parseFloat($(a).find("td").eq(3).text()),l=parseFloat($(a).find("td").eq(4).text()),p=r/t*d*n,i=o/t*s*l;return i-p});$("table tbody").html(e)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment