Loathement as a table
Because focusing on negativity seems like a smart thing to do. This could be considered a wall of shame, if
my opinions were worth feeling shame over. But since they're not, this is more akin to yelling curses at my
furniture after banging my toe against them.
Throughout the years I've had a handful of separate times where I needed to use
LibreOffice (or OpenOffice) instead of doing literally anything else. And every single
time, no matter how miniscule or normal or insignificant my task was, the shit would
crash in the middle of whatever I was doing.
It's inconceivable to me that a suite of tools designed from the ground up
could possibly be having such egregious problems with instability. Any day when I have
to use LibreOffice I consider to be a bad day, and I would rather miss doing whatever
the fuck I was doing than accomplish it with LibreOffice.
Regexes, but neater and more cumbersome
Say you wanted to use regex to find matches of any valid CSS color names in some source haystack of text -
as people often do, I'm sure. Considering that the list is pretty fukken big,
and your time is precious, you would probably just multiline-edit the list in your code editor into a simple
regex.
aliceblue
antiquewhite
aqua
aquamarine
azure
beige
bisque
black
blanchedalmond
blue
blueviolet
brown
burlywood
cadetblue
chartreuse
chocolate
coral
cornflowerblue
cornsilk
crimson
cyan
darkblue
darkcyan
darkgoldenrod
darkgray
darkgrey
darkgreen
darkkhaki
darkmagenta
darkolivegreen
darkorange
darkorchid
darkred
darksalmon
darkseagreen
darkslateblue
darkslategray
darkslategrey
darkturquoise
darkviolet
deeppink
deepskyblue
dimgray
dimgrey
dodgerblue
firebrick
floralwhite
forestgreen
fuchsia
gainsboro
ghostwhite
gold
goldenrod
gray
grey
green
greenyellow
honeydew
hotpink
indianred
indigo
ivory
khaki
lavender
lavenderblush
lawngreen
lemonchiffon
lightblue
lightcoral
lightcyan
lightgoldenrodyellow
lightgray
lightgrey
lightgreen
lightpink
lightsalmon
lightseagreen
lightskyblue
lightslateblue
lightslategray
lightslategrey
lightsteelblue
lightyellow
lime
limegreen
linen
magenta
maroon
mediumaquamarine
mediumblue
mediumorchid
mediumpurple
mediumseagreen
mediumslateblue
mediumspringgreen
mediumturquoise
mediumvioletred
midnightblue
mintcream
mistyrose
moccasin
navajowhite
navy
oldlace
olive
olivedrab
orange
orangered
orchid
palegoldenrod
palegreen
paleturquoise
palevioletred
papayawhip
peachpuff
peru
pink
plum
powderblue
purple
rebeccapurple
red
rosybrown
royalblue
saddlebrown
salmon
sandybrown
seagreen
seashell
sienna
silver
skyblue
slateblue
slategray
slategrey
snow
springgreen
steelblue
tan
teal
thistle
tomato
transparent
turquoise
violet
wheat
white
whitesmoke
yellow
yellowgreen
So something like that ^ turns into something like this v
That'll definitely work just fine, and is quite simple and fast to write even by hand. But what you gain in
ease-of-creation, you lose in performance and length. Given a large enough set of
words, this naïve pattern could easily end up biting you in the ass. Another option would be to organize the
pattern into a Trie-structure
aka. a prefix tree,
like so:
Basically, instead of listing each word in its entirety as a flat list in the pattern, you create capture
groups of the words based on their alphabetical prefixes. Now, granted, I doubt many people would opt to
create these sorts of patterns by hand. So the trie-based patterns definitely cause a bit more friction for
the developer during the pattern creation. But apparently these are a shit-ton faster to execute, and
usually end up a lot shorter. With the color names I used here as an example, the naïve pattern is 1501
characters long, while the triegex ended up being just 1185 characters. I'm not mathematician, but I
do believe that's a solid third less wasted space. Ain't that dank.
Way to style input[type='range'] tracks' progress
Firefox was the only option
If you ever wanted to apply custom styles to the
progress track
of <input type='range' /> elements, you could do so with the proprietary ::-moz-range-progress
CSS selector.
Of course life can't be so easy that this would work in all the major browsers. For example, Chromium -based
ones haven't really ever had a practical solution to accomplish this with just pure CSS. There are some
nasty hacks like having a big box-shadow on the left side of the slider thumb, or implementing
the whole thing with Javascript. But those have major drawbacks, and are not suitable for many use-cases.
Thankfully nowadays with the invention of
CSS anchor positioning
, this can be accomplished quite easily in all the latest major browsers
. If you're on some latest Chromium -based desktop browser, the following code is a minimal demonstration
of how this method works.