Hello, my name is Nicholas Wilcox (he/him). You can call me Nick.
I am a software engineer based in Austin, TX. My hobbies and interests include tennis, baking, media/tech criticism, mathematics, and “creative coding”. This website is simply another blog/portfolio.
I am primarily a TypeScript developer who specializes in full-stack web applications. You can find me and most of my work on GitHub @nicholas-wilcox, and you can read my blog here. I also maintain the Stella's Stunners website at mathstunners.org.
On the left, you can see my recent top albums on my Last.fm account as well as my RSS feed.
Creating Obsidian Plugins
6 days agoI don't use Obsidian that much because I'm busy using Confluence for work. However, like many others I was impressed with how my notes in Obsidian could be linked to or embedded in other notes. I felt as though I could express connections that formed between ideas as I thought them in my mind... even if I did not put much effort into doing so.
In spite of my general approval, I was dissatisfied with Obsidian's templating features. The core Templates plugin is basically a copy-and-paste operation with variables, so no changes in the template will propagate to the notes that were generated with the template.
To address this, I developed a plugin to integrate the Pug templating engine as a code block processor that dynamically renders HTML templates. I also created another plugin that integrates Tailwind CSS and automatically generates a stylesheet with atomic CSS classes that you use in your notes.
How I Use the Last.fm API
22 days agoI've integrated the Last.fm API into my website so that I can listen to an album, scrobble it, and expect a link to show up on my website for the next few days.
I call the user.getTopAlbums
method and query for the most played albums over the last seven days. If I listen to a new album, then it jumps to the top of the list and stays there for a week. Alternatively, if I shuffle a playlist, then different albums trade places between the middle and end of the list. I also limit the number of results to a Top 50.
However, if two albums have the same number of plays (over the past week), then Last.fm sorts them by the artist name. This poses a problem, since my recently played albums typically taper off in playcount, such that all albums ranking below #20 or #30 have only one play. Therefore, if I listen to a bunch of different songs from a bunch of different albums, then albums by artists whose names are sorted last alphabetically might not even make it on the list.
In this blog post, I'll go over how I get around this limitation and implement a recent top albums list that uses my recently played songs to order albums with the same number of plays.
Lit Modal Portal
1 month agoI don't use it much, but I do like the Lit web component framework. Libraries like Lit are great for developing reusable web components that can be dropped in anywhere.
I also believe that Lit is a terrible choice for building Single Page Applications (SPAs). I believe this because once upon a time, I joined a team to work on a Lit SPA that had already been in development for over two years because things like routing had to be implemented from scratch and integrated with Lit. (There was much more nonsense involved that caused delays, but I'm choosing to leave that in the past 😉.)
One such problem we created in order to solve ourselves was the task of implementing modal windows. As useless as the work was for that specific project, the result was something worth holding onto and, with permission, publishing as an open source package on NPM, lit-modal-portal.
TypeScript Helper Functions for Sorting
1 month agoI'm not a huge fan of the Array.sort()
method in JavaScript. When I want to sort an array of some random data type based on non-trivial criteria, I find it tedious to write the body of the compareFn
argument to derive a comparable value from each of two arguments, compare those values myself, and then return -1, 1, or 0 as appropriate.
Below are some helper functions I like to use when sorting complicated data in TypeScript. The first is a compare()
function that takes care of returning -1, 1, or 0 based on the two input values, and the second is a generic sortBy()
function that accepts an array and a function to derive a comparable value from each item in the array.
Some notes:
I've added function overloads so that the
compare()
function can only be used to compare either a pair of numbers or a pair of strings. Likewise, thesortBy()
function has overloads that only acceptcompareBy
arguments which return either numbers or strings.The
sortBy()
function passes the return value ofarray.sort()
. This means thatsortBy()
sorts arrays in place and returns a reference to the input array. You may wish to implement atoSortedBy()
function that usesArray.toSorted()
.
Date Format Selector
2 months agoSome time ago, I created a small application with interactive form controls that fed into the Date.toLocaleString()
function. I generally prefer standardized functions over third party dependencies, but I found it hard to experiment with the Date.toLocaleString()
function and build an intuition for using it.
The result of my effort is the Date Format Selector, which you can find hosted on GitHub Pages at https://nicholas-wilcox.github.io/date-format-selector/
. You can also find the source code here.
Site Update
2 months agoI finally got around to refining my website's layout. I still like the overall structure, but it was terrible on medium sized viewports.
I put too many styles in the root layout, and I needed to pull that out into a separate component that could be configured differently depending on whether there was any content in the sidebar portion. (There's a lot about how Next.js renders layouts that affected my development here.)
Anyway, I've also worked on including code snippets into my blog posts. I don't see myself writing full-fledged tutorials anytime soon, but I'd certainly like to show some code I've written and talk about it. 😊
Christmas Cookies
2 months agoI find it difficult to buy gifts for people, especially for the holidays, so this year I decided to bake a bunch of cookies and give out cookie boxes along with some copies of the new Puzzmo book. This worked out well, because in addition to two cookie boxes I gave to coworkers, I had four more boxes worth of cookies to go with four books to be gifted to four couples in my girlfriend's family (including us 😉).

Pictured above are more of the same cookies I made for a party with our D&D group to celebrate my girlfriend coming back home from Switzerland. The recipes used are:
King Arthur Baking Company's peanut butter cookies (recipe link), to half of which I added some Hershey's kisses.
Eric Kim's gochujang caramel cookies (recipe link). I've made these cookies around ten times by now, and they are a crowd favorite every time. I've become very methodical in how I distribute the gochujang mixture into the cookie dough, rolling the dough out, spreading the gochujang, and folding it a few times before chopping and rearranging chunks of layered dough.
Jesse Szewczyk's chocolate and vanilla swirl cookies, which you can find in his book Cookies: The New Classics. My girlfriend's sister actually got this for me for Christmas, and it immediately became my favorite cookbook.
Finally there are some snickerdoodle shortbread cookies, also from Jesse Szewczyk's book, which were also a favorite among my taste testers.
Here we go again
3 months agoTrump is re-elected, cohost is set to finally disappear at the end of the year, and my attempts to "do everything myself" with respect to personal web development blew up in my face. I'm no longer an idiot who tries to self-host an open-source CMS to store blog posts.
On the bright side, my long-distance relationship is soon to no longer be long-distance. My girlfriend and I are both very excited to hibernate over the holidays together and get married next year. My parents still don't approve of our relationship, but at least they're sorry they weren't upfront about that. 🤷
Not sure what the future holds, but overall I want to take my personal projects less seriously and take some time to reassemble my portfolio in a way that blends into an RSS feed.