Javascript minification with sed

I added a few of my projects to I'm not sure what for, but eh, it's free link estate ! I stumbled upon a touch type trainer in 2 KB of js. The best thing about it is not really the tool (it's limited, obviously) but the absurd way the author got down to that 2kb size, in particular this little gem.

sed -i 's/tutor-window/tw/g' "$target"
sed -i 's/tutor-container/tc/g' "$target"
sed -i 's/tutor-completed/tm/g' "$target"
sed -i 's/tutor-cursor/tr/g' "$target"
sed -i 's/tutor-uncompleted/tu/g' "$target"
sed -i 's/tutor-result/te/g' "$target"
sed -i 's/tutor-status/ts/g' "$target"
sed -i 's/current-layout/cl/g' "$target"

I have no words, it's beautiful :)

I remember going to similar extremes on importabular.

All the private methods had names prefixed by an underscore, and then i had some instructions for the minifying tool to not keep names with that prefix.

It shaved a few kilobytes from the already tiny lib, but i reverted it after to make it easier to subclass the Importabular class.

Anyway, gzipped code golf is always a lot of fun.