A feed of short notes, thoughts, or ideas, preserved here on SeanMcP.com.


Sean McPherson

Every time I use esbuild, I’m impressed with its simplicity and speed. This new generation of JS tooling is really exciting!

Sean McPherson

Google Chrome has been crashing on me without warning the past two weeks, so I’m going to give Microsoft Edge another try. Nice to see that there are more extensions available in Edge Add-on store.

Sean McPherson

Pop quiz: What does the following evaluate to in JavaScript?

Object.keys('hmm...').length

Answer: 6. Here JS treats the string as a type of array which itself is a type of object. Who knew!

Sean McPherson

Netlify is moving their React UI component library to Tailwind CSS:

what started with organised PostCSS gradually grew to become a complex and entangled global CSS architecture with a lot of specificity and overrides. … the added tech debt it introduces makes it difficult to keep shipping fast without adding any regressions. Besides, as the number of frontend developers contributing to the codebase also grows, this kind of CSS architecture becomes even more difficult to work with.

To accomplish this, they set a deadline, divided the work across their front-end guild, and tracked their progress on GitHub. They added some internal tooling for visual-regression tests and to make building class lists easier, especially for conditional cases.

Read more about Netlify’s adoption of Tailwind CSS here

Sean McPherson

One of the things I miss most about Windows when working on macOS is the window management.

I’ve tried a few window management apps in the past, and today I’m giving Rectangle a spin. So far, the keyboard shortcuts feel logical and the app isn’t trying to do too much.

We’ll see how it goes!

Sean McPherson

Today I learned that in Vim :w stands for “write” and is not a weird alias for “save.” That’s much easier to remember.

Sean McPherson (Edited)

I added a /uses page to keep track of the extensions and programs that I use everyday. Nothing is revolutionary, but there are a few extensions and user scripts that I find helpful.

Sean McPherson

github1s is the coolest thing that I have seen in a while. By changing the url of any GitHub repository, you can open the repo in a VS Code browser. This is begging for a userscript to add a link to every GitHub repo

Sean McPherson

When I was teaching, teachers had a popular aphorism: “You really know something until you have to teach it.” Today I learned that this idea was given the term “the illusion of explanatory depth” (IOED) by psychologists in 2002.

Further reading: [0], [1], [2], [3], [4]

Sean McPherson

To find the date a file was created in Node, you can use the fs.stat or fs.statSync methods and look for birthdate. See this answer on StackOverflow.

This might work differently based on your operating system, so your mileage may vary.

Sean McPherson

Nunjucks and Liquid have different methods for passing arguments to a filter.

In Nunjucks, it’s:

{{ 'value' | filter('arg') }}

In Liquid, it’s:

{{ 'value' | filter: 'arg' }}
Sean McPherson

Each note is a simple markdown file. All the data necessary to render on the screen is set at a higher level, so it’s super simple.

Edit: Okay, I needed to add a date field.

My favorite part of this setup is that I can commit a new note through GitHub, which automatically triggers a Netlify build.

Sean McPherson

Why messages? I really like the idea of preserving content that would otherwise be shared on social media on my own site.

It’s definitely not the most popular option (in fact, I doubt anyone else will read these), but I think it’s the right decision in the long run.