TIL is my collection of short, technical daily learnings. 254 and counting.
JSDoc Deprecations in TypeScript
JSDoc has a @deprecated tag that you can use in TypeScript, too. Here’s an example. ...
TIL is my collection of short, technical daily learnings. 254 and counting.
JSDoc has a @deprecated tag that you can use in TypeScript, too. Here’s an example. ...
I’m reading How to Open Source by Richard Schneeman (fantastic) and one of his tips is to show documentation code like this (consider documenting ls): ls <desired-path> Rather than the common: ls /your/path/here ...
When upgrading a dependency for a security issue, we might upgrade and move on: npm install <dependency>@<version> But wait! Was every <dependency> version upgraded, or just the version in package.json? Check with: npm list // or npm ls ...
Today while reading the Rust Documentation, I encountered a fantastic UX touch. The authors provide this image with each code block that intentionally doesn’t compile: ...
Images in Hugo can be a bit tricky. Here’s how I’ve added images on my projects page that are resized, linked, and have alts: the figure shortcode. {{< figure src="/images/yiap.png" alt="Yes, It's a Problem" link="https://github.com/jwworth/yes-its-a-problem" width="600" >}}
Sometimes I want to iterate on an alias. You can unalias an alias like this: unalias aliasname ...
Today I discovered these two Vim flags: vim -w log.txt file vim -s log.txt file The -w flag sends all keystrokes in your session to log.txt. The -s loads Vim and replays all the keystroke back onto that file. ...
I’ve been writing some non-printing characters to a file. But when I concatenate, it appears empty. cat log.txt # Nothing here 🥺 cat those non-printing characters with -v: cat -v log.txt jjjj:wq^M% ...
I was doing a Vite demo last week, I changed some markup, and visited the local web server. The markup changed, but the state persisted. What?! This is Vite’s Hot Module Replacement API. ...
Prettier formats code in fenced code blocks! When I type three backticks and then a code, Prettier evaluates the code in the block and tries to format it per my global .prettierrc. ...