Skip to content

Instantly share code, notes, and snippets.

@hrach
Created December 18, 2012 22:11
Show Gist options
  • Save hrach/4332545 to your computer and use it in GitHub Desktop.
Save hrach/4332545 to your computer and use it in GitHub Desktop.
$('.ameta').each(function() {
var i = $(this).find('.a').text();
i = i.substring(0, i.length - 3).replace(',','');
var d = $(this).find('.d').text();
d = d.substring(0, d.length - 3).replace(',','');
$(this).parents('li').data('rank', i - d);
});
var l = $('.contrib-data');
var list = l.find('li').sort(function(a,b){ return $(b).data('rank') - $(a).data('rank'); });
l.find('li').remove();
l.append(list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment