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
The Rise & Fall of National Rail Networks / / No Comments The Berliner-Morgenpost has visualized the rise and fall of the German rail network from its rapid growth in the 19th Century right up to its 21st Century post-privatization contraction. The German Rail Network from 1835 Until Today uses an interactive map to show all the active rail lines in Germany for every single year from 1835 until 2022.On December the 7th 1835 a six-kilometer rail line Maps Mania… more → Posted in: Interactive Maps Tagged with: Fall, National, Networks, Rail, Rise
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
Standing on Top of the World / / No Comments If you want an uninterrupted view towards the horizon in all directions then you need to stand on top of a mountain. But not just any mountain. What you need is an ‘on top of the world’ mountain. On Top of the World Mountains An “on top of the world” mountain, also known as an OTOTW mountain, is a mountain that is so high that no other mountains can be seen above the horizon from its summit. Maps Mania… more → Posted in: Interactive Maps Tagged with: standing, World
Peering into the Heart of Darkness / / No Comments This week the European Space Agency released the first full-color images from the Euclid telescope. Euclid is a space telescope (situated in a halo orbit at an average distance of 1.5 million kilometers beyond Earth’s orbit) which has been tasked to explore dark energy and dark matter. The telescope is capturing highly detailed astronomical images across a large area of the sky. The first five Maps Mania… more → Posted in: Interactive Maps Tagged with: Darkness, heart, into, Peering
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
The Interactive Pathfinding Map / / No Comments The Pathfinding Visualizer is an interactive pathfinding tool that allows you to discover the most direct route between any two points in the world, using a number of different pathfinding algorithms. A map pathfinding algorithm is a way to find the shortest or most efficient route between different points on a map. It helps you find the best path to go from one location to another, considering Maps Mania… more → Posted in: Interactive Maps Tagged with: Interactive, Pathfinding
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