Skip to content

Instantly share code, notes, and snippets.

@solex
Created November 11, 2010 11:46
Show Gist options
  • Save solex/672382 to your computer and use it in GitHub Desktop.
Save solex/672382 to your computer and use it in GitHub Desktop.
The bookmarklet that makes Reddit comments look like Python
javascript:(function(){$('.commentarea%20.tagline').each(function(){var%20u=$(this).find('a.author'),t=$(this).find('.unvoted').html();var%20p=t?t.split('%20')[0]:"None";$(this).empty().append('<span%20style="color:#00f;font-weight:bold">def%20</span>').append(u).append('(points='+p+'):')});$('.commentarea%20.usertext-body').css('padding-left',24).find('.md').css('color','#393').prepend('"""').append('"""');$('.commentarea%20.flat-list.buttons').each(function(){$(this).appendTo($($(this).parents('.comment')[0]).css('padding-bottom','16px'));$(this).find('li').prepend('<span%20style="color:#00f;font-weight:bold;padding-left:42px">return</span>%20').not('.first').remove()})})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment