Show HN: HN Avatars in 357 bytes
523 by tomxor | 318 comments on
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
Subscribe to:
Post Comments (Atom)
New best story on News: AMD expects to outsell Intel in Q4 for the first time in history
AMD expects to outsell Intel in Q4 for the first time in history 568 by rbanffy | 210 comments on News.
-
Show HN: 2048 turned 10 this year, I built an updated version to celebrate 496 by terabytest | 168 comments . Hi all! My name is Gabriele...
-
France to ditch Windows for Linux to reduce reliance on US tech 451 by Teever | 185 comments on
-
Deep Reinforcement Learning: Zero to Hero 484 by alessiodm | 43 comments on News.
No comments:
Post a Comment