Hendrik Lammers
Home
Notes
Contact
Once you stop learning, you start dying
Notes and learnings
Bash
Execution time of CLI command
Find process running on port
Count the files in a directory
Last argument of the previous command
Brace expansion in bash
Single vs double brackets
Chrome
Last selected DOM element in the console
Chrome task manager
Emulate a focused page
CSS
CSS cascade layers
Variable fonts
Custom underline with CSS
Negate a CSS variable
The @supports query
CSS gradient text
The :focus-visible pseudo class
String value as list-style-type
HSL color in CSS
Docker
Remove dangling Docker images
Git
Search in history with git log
Compare a file between 2 branches
Show commits in a branch
Resolve merge conflicts in package-lock.json
Git force with lease
Ignore already tracked files in Git
JavaScript
Making sure web fonts are loaded
Use FileReader to preview an image
Check object property with Object.hasOwn()
Get query params from URL
Deep cloning in JavaScript
Sort with localeCompare()
Nullish coalescing operator (??)
jq
Get value without quotes
Filter by value
Pretty print JSON with jq
Mac
Copy pathname of a file/folder in Finder
Show MacOS app switcher on all displays
Node.js
Working with multiple npm accounts
Use local version of a npm package
Difference between path.resolve and path.join
React
useLayoutEffect and SSR
Rust
Tab completions for Rust/cargo in Zsh
TypeScript
Typesafe exhaustive switch statements
Generic arrow functions in TSX
User-defined type guards
Type Node environment variables
The never type
Vim
Write file without auto format
Count the number of words
Spell checking