The Grimoire
Inspired by the grimoire of Fred Bednarski, this is my place to put assorted snippets of code (which may or may not be cursed, so use at your own risk).
Last updated: April 11th, 2021
Dithering images for this website
convert <img> -colorspace gray -ordered-dither o8x8 o.png
Download mp3 audio from youtube video
youtube-dl --add-metadata -i -x -f mp3/bestaudio <url>
Center element in parent div
.flex-center { align-items: center; justify-content: center; flex-direction: column; }
Use a node module locally
yarn link
— in the module directory
yarn link module_name
— in project that will use the module
Hide unimportant stuff in VSCode (from the console)
[...document.querySelectorAll('.title')].map(a => a.style.display = 'none');
[...document.querySelectorAll('.decorationsOverviewRuler')].map(a => a.style.display = 'none');
userChrome.css for Firefox, to be hide chrome boilerplate
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#navigator-toolbox {
height: 0px !important;
min-height: 0px !important;
overflow: hidden !important;
}
#navigator-toolbox:focus,
#navigator-toolbox:focus-within,
#navigator-toolbox:active {
height: auto !important;
}