hzrd149's avatar
hzrd149
_@hzrd149.com
npub1ye5p...knpr
JavaScript developer working on some nostr stuff - noStrudel https://nostrudel.ninja - Blossom https://github.com/hzrd149/blossom - Applesauce https://hzrd149.github.io/applesauce
hzrd149's avatar
hzrd149 5 days ago
In case anyone is wondering what my avatar is, its the smallest most interesting SVG shape I could hand code back when astral.ninja was the main nostr client. When I joined nostr it was out of curiosity, so naturally I wanted to test what would break if I set my profile image to a data URI. but at the time astral.ninja limited the "picture" field to maximum length of 256 which meant that if I was going to build a data URI that would fit I would only be able to do SVG and probably only have a single <path> element. This is the SVG I ended up writing: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path fill="#fff" d="M0 0h10v10H0z"/><path d="M2 4h4v4Zm0-2v6h6Z"/></svg> The main path "M0 0h10v10H0z" takes advantage of the fact that the fill area on paths inverts when it crosses itself. which allowed me to make the white space in the middle. So in total this SVG encoded to a data URI has a length of 206, just enough to fit into the "picture" field in astral.ninja, although as you would imagine It didn't work so I went back to a PNG profile picture :D image
hzrd149's avatar
hzrd149 5 days ago
I'm very impressed with GSD so far for maintaining libraries. For the past few days I've been running it over applesauce and its managed to find at least 10 subtle bugs that would have taken me at least a month to discover.