JavaScript: Reverse Arrays / / No Comments Manipulating data is core to any programming language. JavaScript is no exception, especially as JSON has token over as a prime data delivery format. One such data manipulation is reversing arrays. You may want to reverse an array to show most recent transactions, or simple alphabetic sorting. Reversing arrays with JavaScript originally was done via reverse but that would mutate the original array: // First value: const arr = ['hi', 'low', 'ahhh']; // Reverse it without reassigning: arr.reverse(); // Value: arr (3) ['ahhh', 'low', 'hi'] Modifying the original array is a legacy methodology. To avoid this mutation, we’d copy the array and then reverse it: const reversed = [...arr].reverse();... more → Posted in: JavaScript Tagged with: Arrays, JavaScript, Reverse
Discovering the Dissolution / / No Comments I live near Abbey Road in East London. The road is named for Langthorne Abbey, which used to be one of the largest Cistercian abbeys in England. At the beginning of the 16th Century the abbey owned most of the land in East London. It also owned a number of local mills and controlled a number of local industries including brewing, shearing, weaving, tannery and farming. Then came the Dissolution Maps Mania… more → Posted in: Interactive Maps Tagged with: discovering, Dissolution
Creating Bootstrap WebC Components in Eleventy / / No Comments For some time now as I’ve explored web components, it’s occurred to me that web components could be a great way to make working with Bootstrap simpler. Not that Bootstrap is necessarily difficult, but I’ve always thought it would be cool to take something like so: <div class="card" style="width: 18rem;"> <div class="card-body"> <h5 class="card-title">Card title</h5> <h6 class="card-subtitle mb-2 text-body-secondary">Card subtitle</h6> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> </div></div> And... more → Posted in: JavaScript Tagged with: Bootstrap, Components, creating, Eleventy, WebC
Confessions of a Web Developer XX / / No Comments It’s been quite a while since I’ve gotten a few things off of my chest and since I’m always full of peeves and annoyances I thought it was time to unleash: One day you’re getting recruited by another crypto wallet vendor, the next their users are getting drained of funds. Dodged a bullet there… Apple has released its XR headset but XR as a daily experience is still decades away. I worked on Mozilla VR 10 years ago and the industry hasn’t gained an ounce of traction since then. Why?… …because the truth is that no one wants to put on a headset, looking like an idiot, for experiences. Augmented reality’s success requires the least amount... more → Posted in: JavaScript Tagged with: Confessions, Developer
The Kessler Syndrome / / No Comments Steve Wozniak and a host of other Silicon Valley luminaries have launched a new company called Privateer, whose mission is to track and map space debris in Earth’s orbit. In 1978 NASA scientist Donald J. Kessler published a paper which argued that if the number of satellites in Low Earth Orbit reached a certain critical level, then even a small collision could create enough debris to cause a Maps Mania… more → Posted in: Interactive Maps Tagged with: Kessler, Syndrome
Using Goodreads Data in Eleventy / / No Comments I’ve been a Goodreads user for a few years now, and much like how I use other ‘tracking’ services, I’m not there for other folks’ reading lists or recommendations, but instead, as a way to track what I’ve read. I especially like looking back over the past year and being reminded of the books I really enjoyed. Recently, myself and others were talking on Mastodon about how to work with this kind of data, other services, and so forth. Goodreads does not have an API unfortunately (it used to, but it shut it down) but they do let you export your data. I decided to take a look at this and see if (and how) it could be used in Eleventy. Here’s what I found. Edit... more → Posted in: JavaScript Tagged with: data, Eleventy, Goodreads, using
AI Map Search / / No Comments I am trying to keep track of developments in the use of artificial intelligence in mapping. At the moment the most interesting experiments seem to involve using AI to help answer geospatial queries. This is leading to some interesting maps which use AI to map answers to users’ queries. Over the last few months I’ve been reading with interest on Twitter how developers have been using AI models ( Maps Mania… more → Posted in: Interactive Maps Tagged with: search
Quick example using AWS Node.js SDK V3 for Signed URLs / / No Comments This probably falls into the "it was easy for everyone else in the world but me" bucket, but I really struggled to find good search results for this and figured I’d better write it down so when I google for it again in a few months, I’ll find my own blog. Specifically – today I was trying to use the AWS Node.js SDK to generate signed URLs. One to create read-only access to a bucket item and another to allow uploading. Everything I’m sharing is covered in the docs, but I struggled to find the relevant parts. So first off, V3 of the SDK is modularized, so instead of installing a giant SDK, you get just what you need. A lot of the demos show S3 so that’s handy.... more → Posted in: JavaScript Tagged with: example, Node.js, Quick, Signed, URLs, using