126 TILs and counting...

Locally test on old version of Chrome

Today I learned that if you need to test in older versions of Chrome then you can download prior snapshots of Chromium builds as standalone executables. The tricky part is figuring out which build snapshot corresponds to which version of Chrome, which involves several steps detailed in the Chromium wiki. Fortunately, someone put together a site to lookup by Chrome version and link to the correct build on the archive site....

May 20, 2024 · 1 min · Brandon Pugh

Podman is a nice alternative to Docker

Today I learned that Podman is a pretty nice alternative to Docker, and in my case was a drop-in-replacement for Docker Desktop. The installation process was smooth and it really tries to guide you through the setup. They even provide cli aliases for docker commands so you don’t have to update any existing scripts. Proponents also argue that it has more secure default feature like rootless containers. Exploring Podman: A More Secure Docker Alternative

April 18, 2024 · 1 min · Brandon Pugh

Preload critical assets

Today I learned that you can preload critical assets in a page by using the preload attribute on a link tag i.e. <link rel="preload">. Especially useful for things like fonts that are discovered later by the browser. Preload critical assets to improve loading speed

March 13, 2024 · 1 min · Brandon Pugh

Shell Check

Today I learned about ShellCheck which is essentially a linter for bash scripts. You can try it on the website but I recommend installing the vscode extension. I like that you can look up the rationale for each of the rules so it’s a great way to learn some best practices for bash scripts.

March 12, 2024 · 1 min · Brandon Pugh

Windows Dev Drive

Today I learned about a new feature in Windows 11 called Dev Drive. It sounds like it essentially lets you create an optimized drive or volume for heavy file I/O that could speed up large solutions or test suites. Doesn’t look like I’m able to enable this on my work laptop yet but I’m curious to try it on one of my personal machines and see if it’s a noticeable improvement....

February 26, 2024 · 1 min · Brandon Pugh

Truncate table

Today I learned that there is a truncate table SQL command that deletes all data from a database table like Delete from but is faster and uses fewer system and transaction log resources. It’s supported in most database engines but there are likely caveats to keep in mind. For instance, with SQL Server: It will reseed identity columns You can’t truncate tables that referenced in constraints and it requires ALTER table privileges For clearing out data in lower environments though, I’ve found it useful....

February 20, 2024 · 1 min · Brandon Pugh

Logical Properties

I’ve recently been learning about the new logical properties in CSS. Essentially if we’re developing applications for a global audience, instead of thinking in terms of right/left or top/bottom, we should start thinking in terms of “inline” and “block”. These let us specify our styling and layouts in relative logical values instead of physical ones so they can adapt appropriately for right-to-left or vertical languages. For example, margin-left: 20px would now be margin-inline-start: 20px....

February 15, 2024 · 1 min · Brandon Pugh

Git Maintenance

Today I learned about the git maintenance command that runs tasks for regular maintenance of a git repo. If you run git maintenance start in a repo, git will create scheduled tasks to run at regular intervals to perform these tasks in the background like garbage collection. This will optimize and speed up the repo without having to tack them on occasionally as you run other commands. A particularly handy task it will run every hour is prefetch, where it does a git fetch but only pulls down the data and doesn’t update any refs....

February 12, 2024 · 1 min · Brandon Pugh

Number.isInteger()

Today I learned that the isNaN global function in javascript isn’t very useful for validating numbers. The main reason is that it returns false for an empty string since it coerces it to 0. To add to the confusion, Number.isNaN() behaves slightly differently since it just checks for the value NaN. For validation, I found Number.isInteger() to be the most useful.

February 8, 2024 · 1 min · Brandon Pugh

Git ORIG_HEAD

Today I learned that ORIG_HEAD is a reference that git maintains to the previous commit HEAD pointed to before it “was modified in a drastic way”. The docs mention these operations as examples of when ORIG_HEAD is updated: (git am, git merge, git rebase, git reset) This is useful when you want to undo one of those operations. You can use git reset --hard ORIG_HEAD (or --keep) to put your branch back to where it was before the operation....

February 7, 2024 · 1 min · Brandon Pugh