Lurker News
Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code)

  for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i<28?r>>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r<<13,r^=r>>>17,r^=r<<5,X=i&3,Y=i>>2

Comments (493) 108 threads

Earlier comments
a_t482 replies#
It would be neat if the code also applied to the username in the top right so I didn't have to make a spammy comment to see what it gives me. ;)
jumperabg1 reply#
Just F12 and manually edit some username, after that re-paste the code and you will see the avatar.
usrme#
The other way is to just navigate to your own profile page and apply the script there.
totetsu#
Just replace the '.hnuser' bit with '.hnuser, #me'
red_skull_qc__#
People could carefully choose their username to match a desired avatar!

It could be a fun coding challenge to try to generate usernames which match a relevant avatar ;)

maebert#
Reading the comments, this feels like a giant Rorschach test for HN...
AussieWog93#
This is actually a really useful feature. Makes it easy to see at a glance who is interacting with whom in a thread.

Load more comments