185 TILs and counting...

Penpot

I just heard about a promising new design tool called Penpot that positions itself as an open-source alternative to Figma. They recently added support for CSS grid layout which I’m looking forward to testing out. https://www.smashingmagazine.com/2024/04/penpot-css-grid-layout-designing-superpowers/

BFCache

Today I learned that the Backwards/forwards cache (BFCache) is a thing. This is the cache where the browser keeps a snapshot of a webpage so that it’s able to display almost instantly when a user clicks the back or forward buttons. This post gives a nice overview of the BFCache and how it works — apparently “Chrome usage data shows that 1 in 10 navigations on desktop and 1 in 5 on mobile are either back or forward”. ...

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. Then you download and extract the zip file and run the single executable, i.e. chrome.exe.

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

 · 1 min · 

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

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.

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. ...

 · 1 min · 

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.

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. ...

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. Then when you actually run git fetch or git pull, it completes almost instantly because it already has all the data. ...