ETOOBUSY 🚀 minimal blogging for the impatient
A few tricks about pasting online, learned during the 2021 Advent of Code
Well, actually while lurking in the Solutions Megathreads in Reddit.
What… what? A link to where?!? Well, to the page itself, which will decode most of the URL itself to get the data to show. This is such a neat trick.
The pasted text is compressed using LZMA, then encoded to make it URL safe. Overall a brilliant idea, I wonder whether using Brotli would squeeze things a bit more.
This is so cool because the code isn’t actually pasted anywhere - it’s just all there in the URL, so if you want to back it up just save the link!
The drawback is that you end up with a very long URL. This is hardly a problem, e.g. if you’re using Markdown or other ways to render links with a text of choice. In case, anyway, you can gain a lot more compression using a URL shortener service like bitly. As an example:
- some code for day 15 is available as https://topaz.github.io/paste/#XQAAAQC3DQAAAAAAAAARiE…yMy8Z5zcslpkD/6U9WqA== which is… a bit long;
- this is the same link
- and of course this: https://bit.ly/3ITbxMd
This was not the only discovery about pasting stuff though. Thanks to s3aker I discovered glot.io, which not only allows pasting stuff in a variety of syntax-highlighted languages, but also allows executing that code!
Well, it’s about time to pass past this post about pasting! Stay safe!