Awesome Netlify Updates / / No Comments For about two months now I’ve had on my queue to write about some of the incredibly cool updates Netlify has released but I just didn’t have the time. I’ve been hosting this blog on Netlify for a few years now and have been incredibly happy with the platform, but the updates the past two months have been both surprising and just really freaking cool. Here’s a quick look at what impressed me. As a quick aside, this isn’t necessarily everything announced recently and you can take a look yourself at their blog for more changes. Caching Improvements # This is an area I haven’t really done much in – both on my site or elsewhere. I generally let Netlify worry... more → Posted in: JavaScript Tagged with: awesome, Netlify, updates
Adding Music Previews to My Now Page / / No Comments About two months or so ago I added a Now page to my site. It shows my current reading list, my last watched movies, my Untappd beer check-ins, and my most recent Spotify tracks. You can see that part here: When I built it, I used a Pipedream workflow to wrap calls to Spotify’s API. My Pipedream workflow gets my most recent tracks, slims down the data quite a bit, and returns just what I need. I use some client-side code to hit that endpoint and then render it out on the Now page. (I also use a bit of caching with LocalStorage such that the endpoint is only hit every ten minutes.) Currently, when rendering each track, I link to its URL and Spotify users can listen to the track completely.... more → Posted in: JavaScript Tagged with: Adding, Music, Page, previews
How to Play Grand Poo World 3 / / No Comments The underground world of creating and streaming Super Mario World-based ROM hacks continues to gain popularity. This popularity is a tribute to the creativity of gamers and the quality of the original 30 year old video game’s mechanics. Over the past decade, incredible ROM hacks like Grand Poo World 1 and 2, Invictus, and Dram World have brought joy (and horror) to the Mario community. Sure, Nintendo released Mario Maker and Mario Maker 2, but I love SMW Central patches because they allow all of us to create, much like open source. The most anticipated hack in years, Grand Poo World 3, was just released and is taking the Super Mario World community by storm. You cannot, however, just download... more → Posted in: JavaScript Tagged with: Grand, Play, World
Using IndexedDB with Alpine.js / / No Comments A lot of my "x with Alpine" blog posts end up being, well, nothing special. That’s a good thing I suppose as it really helps highlight how simple Alpine.js is. (Note, I go back and forth between including the ".js" when referring to Alpine. I should be more consistent I suppose. On one hand, Alpine.js is the formal name, but Alpine just feels simpler.) That being said, the impetus for this post was to get something basic done before I built something a bit more complex. So if you wish to TLDR – it just works, visit my CodePen for the full source, and come back for the next post. If you’re still curious, keep on reading. IndexedDB – Vanilla or Library?... more → Posted in: JavaScript Tagged with: Alpine.js, IndexedDB, using
Adding Simple Routing to Cloudflare Workers / / No Comments I’ve been "playing" with serverless for years now, but honestly still feel new to it. When it comes to organization in a project that uses serverless functions, I’ve typically tried to build one function per operation. So for example, if I had a need to get a list of cats, I’d have one function. If I had a need to get information about a cat based on an identifier, I’d probably build a second one. That being said, I recently came across an example Cloudflare function that did something cool – it used a router, specifically the very lightweight itty-router. Let me share an example of how it works. What is a Router? # So I kinda assume most folks know what... more → Posted in: JavaScript Tagged with: Adding, Cloudflare, Routing, simple, workers
A Tip for Properly Handling Loading States in Web Apps / / No Comments This isn’t something I was going to blog about, but after seeing the same issue a few times recently (although to be fair, last in a mobile game), I thought I’d share it with my audience. I apologize if the title isn’t the best as it was a hard issue to describe, so let me begin by demonstrating the problem, and then the (hopefully) obvious solution. Loading Data # Here’s a super simple example of a web page that loads some data from the API. In this case, it’s the Star Wars API which, unfortunately, has been pretty slow recently. On the flip side, that helps illustrate that issue. The HTML is just an h2 and an empty ul and the JavaScript is fairly simple: document.addEventListener('DOMContentLoaded',... more → Posted in: JavaScript Tagged with: apps, handling, Loading, properly, States
Can GenAI help you win in Vegas? / / No Comments No. Thank you and goodbye. Ok, first off, I apologize for the click-bait style title. Every now and then when I get an idea for a demo, it doesn’t work. But sometimes, it doesn’t work out in a fun and interesting way, and I figure it’s a good idea to share it anyway. (Also, there’s always the strong chance that it didn’t work out because I did something wrong!) Today’s demo is a perfect example of that I think. Earlier this year I built a Blackjack game using Alpine.js and the quite excellent Deck of Cards API. Yesterday I was thinking about the game and I wondered – what would happen if I used generative AI to ask for help when playing it? So for example,... more → Posted in: JavaScript Tagged with: GenAI, help, Vegas
Creating Human-Readable Summaries of Data with Google PaLM Generative AI / / No Comments Like a lot of folks, I’ve been spending a lot of time thinking about generative AI, and AI, in general, and oddly (well for me), trying to focus on productive uses for it when working with APIs. A few weeks ago I shared my initial impressions of Google’s PaLM 2 API, and today I came up with an interesting use case for it. I’ve seen text summarization as a fairly common use case for gen AI, and I agree, it can be incredibly helpful when working with lots of text. However, I got to thinking today, would it be possible to use this as a way to summarize numerical, or other data? So given some process that returns a set of information, can we use gen AI to summarize it? Here’s... more → Posted in: JavaScript Tagged with: creating, data, Generative, Google, HumanReadable, palm, Summaries