Skip to main content

Today I Learned

Table of Contents
There used to be dates next to each of items - without them the “Today” makes a bit less sense ๐Ÿ˜€

pico.css
#

TIL about pico.css - the minimalistic and zero-friction CSS framework for semantic HTML.

It has everything I need to quickly build a data-first site without sacrificing the UX. And I already know itโ€™s going to integrate beautifully with Phoenix LiveView ๐Ÿ˜ˆ

The origins of big- and little-endian terms
#

TIL that the “big-endian” and “little-endian” terms come from Jonathan Swift’s “Gulliver’s Travels” (1726), where they represent proponents of the two opposing ways of breaking eggs.

erlang:term_to_binary/1 compatibility
#

TIL that Erlang guarantees for the :erlang.term_to_binary/1 format to be compatible accross the span of at least two releases - it is surely going to be possible to decode terms encoded in R18 in R20, but not necessarily in R21.

Its seems to be common knowledge for some, but I couldn’t find any hard sources for this, the closest thing is this SO answer with messed up links. Do let me know if that’s not correct.

Yarnbombing
#

TIL about yarnbombing, also known as “guerrilla knitting”.

As far as I’m concerned, the names alone make it awesome.

ncdu
#

TIL about the ncdu tool - the NCurses Disk Usage cli program. It’s like (Win|k)DirStat, only much lighter and more convenient. I’ve been looking for it all my life!

Erlang Dirty Schedulers
#

TIL about Erlang Dirty Schedulers. They seem to be pretty cool if you need to write NIFs.

WTFPL
#

TIL that the Do What the Fuck You Want to Public License has not been approved by the OSI board, not because it was vulgar, but because it wasn’t a license - it was a dedication to the public domain.

Also, if you do want to put your work in public domain, you’re probably better off using the CC0 license.

A 65 byte binary is large
#

I knew that in Erlang/Elixir each of the processes has its own heap and sending messages between processes copies the terms sent, which is why sending large amounts of data might be inefficient. I also knew that “large binaries (strings)” live in a shared heap and processes operate on references to them, so sending those around is cheap.

TIL that any binary longer than 64 bytes is considered a large binary, which was probably a deliberate design choice.

Elixir tuples’ AST
#

TIL that the AST of Elixir tuples isn’t entirely consistent - the 2-tuples are literals:

assert {:{}, _line, []} = Code.string_to_quoted!("{}")
assert {:{}, _line, [1]} = Code.string_to_quoted!("{1}")
assert {1, 2} = Code.string_to_quoted!("{1, 2}")
assert {:{}, _line, [1, 2, 3]} = Code.string_to_quoted!("{1, 2, 3}")
assert {:{}, _line, [1, 2, 3, 4]} = Code.string_to_quoted!("{1, 2, 3, 4}")
assert {:{}, _line, [1, 2, 3, 4, 5]} = Code.string_to_quoted!("{1, 2, 3, 4, 5}")

Apparently it is this way to make Keywords literals as well.

nietaki
Author
nietaki
Elixir specialist learning golang and DevOps