TIL is my collection of short, technical daily learnings. 206 and counting.
Filled Emoji With CSS
Today I learned how to fill in an emoji with CSS. Here’s an example: .filledEmoji { color: transparent; text-shadow: '0 0 0 #86efac'; } ...
TIL is my collection of short, technical daily learnings. 206 and counting.
Today I learned how to fill in an emoji with CSS. Here’s an example: .filledEmoji { color: transparent; text-shadow: '0 0 0 #86efac'; } ...
What I call “wraparound” are repeatable indices on an array. The common use case is a carousel. Here’s how it’s done: const items = ["first", "middle", "last"]; const i = 0; // Our iterable index // "Next" -> const nextIndex = (i + 1) % items.length; // <- "Previous" const prevIndex = (i - 1 + items.length) % items.length;
Here’s a periodic reminder that JavaScript supports string concatenation with a plus sign: > 'foo' + 'bar' 'foobar' ...
Need an array of letters? Here’s a trick: > const alpha = [...'abcdefghijklmnopqrstuvwxyz'] ...
When you join an array in JavaScript, the default separator is a comma: node> ['j', 'a', 'k', 'e'].join() 'j,a,k,e' ...
The JavaScript bitwise AND operator (&) can be used for some real-world tasks, like testing if a number is odd or even. ...
Longtime Vim users know the vimtutor program, which teaches you Vim in Vim. Vim 9.2 shipped with a new :Tutor command that improves on this. :Tutor ...
Is a Docker container available on a registry? Here’s how I’d check, right from the CLI: docker image ls <container-name> ...
When adding CI checks, you can gradually increase rigor while easing your codebase into a better place. ...
I use the append >> and overwrite > redirection operators all the time. Today I’d like to share a simple mental model I’ve developed for remembering which is which. ...