168 TILs and counting...

Conditional logic in pipelines YAML

Today I learned that you can have conditional expressions in Azure Pipelines YAML files: steps: - script: tool env: ${{ if parameters.debug }}: TOOL_DEBUG: true TOOL_DEBUG_DIR: _dbg ${{ else }}: TOOL_DEBUG: false TOOL_DEBUG_DIR: _dbg

 · 1 min · 

Toggle CSS classes in Devtools

Today I learned that the little .cls button in the Chrome devtools is a handy way to toggle classes on an element: I imagine the trend of using utility classes was the main motivation for this feature (although apparently it’s been there for a few years and I only just figured out what it was for).

 · 1 min · 

Copy git link extension

2025-06-16 Update: This is now built-in to Visual Studio. Today I learned about the Copy Git Link extension for Visual Studio which will give you the url of currently selected lines on your git hosting provider i.e azure devops or GitHub. Especially handy for quickly pointing a teammate to a particular part of the codebase.

 · 1 min · 

Git rerere

If you’ve ever had to abort a rebase or merge but didn’t want to waste the work you already did resolving merge conflicts, then you should enable the git rerere option: git global config rerere.enabled true It stands for Reuse Recorded Resolution, and it essentially remembers how you resolved a merge conflict and will automatically reapply if it sees it again. Resolving conflicts with git-rerere

git-absorb

One of my favorite git plugins is git-absorb (which is a port of Mercurial’s absorb). It basically helps you create --fixup commits automatically, which you can then use an interactive rebase with autoSquash to “absorb” them into your previous commits. I tend to use it when I’ve made a bunch of small tweaks to my feature branch, especially from automated feedback from a PR bot, I’ll then stage the changes and git-absorb will find the previous commit on my branch that also modified those same lines. ...

push.autoSetupRemote

Today I learned about the git config setting push.autoSetupRemote that was added in version 2.37.0. Like Tekin mentions in his post, I’ve had a git alias to do create my upstream branch but I still forget sometimes. To me this seems safe to enable by default with: git config --global --add --bool push.autoSetupRemote true and git will now set the upstream tracking branch for you!

Use the valueAsNumber property of html number inputs

Today I learned about the valueAsNumber property of html number inputs. So instead of having to parse the value like: const num = parseFloat(e.target.value) You can do: const num = e.target.valueAsNumber For example in react: return ( <input type="number" value={number} onChange={(e) => { // ✅ const num = e.target.valueAsNumber setNumber(num) }} /> ) Work With Number and Date Inputs in JavaScript

Format a paragraph

In vim you can format a paragraph of prose text with gq. This basically will hard-wrap the lines to the configured textwidth for the filetype. I use this all the time when writing git commit messages so the body of the message has the recommended max line length of 72.

Preserve case with find and replace

Today I learned that vscode has an option to preserve case with find and replace (I somehow never noticed the “AB” button before). I’ve always wanted this when having to rename an entity in a file with instances both capitalized and lowercase. I actually discovered this because I saw that this feature was just added to the latest Visual Studio 2022 preview And for vim users, there’s Vim Abolish 😁

 · 1 min · 

SVG sprites

Today I learned about the <use> element and how you can use it to create SVG sprites. It turns out that my preferred way of working with svgs in react by embedding them in the components, is not great for performance or bundle size. But as Ben Adam’s post shows, it looks like inline svgs using sprites gives you the best performance to development experience tradoff.