Update to My Table Sorting Web Component

Just a quick note. Last year, I blogged a demo of a web component that lets you wrap an existing HTML table and progressively add table sorting. I’m rather proud of that demo and was actually planning on doing a quick video about it, but while testing I encountered two small bugs that somehow missed my earlier rigorous testing. (And by rigorous testing I mean a few minutes of clicking around.) Specifically, the issue is in the "when clicking to sort, notice if we sorted this column before and if so, reverse the sort" area: sortCol(e,i) { let sortToggle = 1; if(this.lastSort === i) { this.sortAsc = !this.sortAsc; if(!this.sortDir) sortToggle = -1; } this.lastSort = i; this.data.sort((a,b)... more →
Posted in: JavaScript

The Loss of the Great American Grasslands

The Cornell Lab of Ornithology and the Act for Grasslands. have teamed up to map the loss of grasslands in the United States. Over 2 million acres of American grasslands are lost on average every year. The result of which has a devastating effect on American wildlife. Using historical satellite records Map for Grasslands has tracked grassland loss in the USA over the last 30 years. By Maps Mania… more →
Posted in: Interactive Maps

Adding Recommendations to my Blog with Algolia

I’ve been using Algolia for my site’s search functionality for a few years now and it works great, especially once the free tier expanded to cover the size of my content somewhat better. In that time, I’ve mainly just stuck to basic search functionality and haven’t really touched any of the more advanced features. This weekend I took a look at one I’ve been meaning to play with for some time, Recommendations. My thinking was, of course, a way to recommend/suggest content related to the current blog post you may be reading. This distinction is important because as I looked at the Recommendations marketing and documentation, the content is heavily focused on product... more →
Posted in: JavaScript

Old Maps Online

Old Maps Online, MapTiler and the David Rumsey Map collection have launched TimeMap.org, a new interactive world map which allows you to explore the history of human civilization over the last 6,000 years. TimeMap promises to throw open the doors to the past, allowing you to explore bygone eras, trace the shifting boundaries of nations, encounter history’s most powerful figures, and witness the Maps Mania… more →
Posted in: Interactive Maps

Using the Gemini File API for Prompts with Media

Using media in your prompts (what’s called ‘multimodal’) with the Gemini API is fairly simple in small cases. You can encode your input with base64 and pass it along with your prompt. While this works well, it’s got limitations that may be quickly hit – most specifically a file size limit of 20 megs. A few months ago, I shared a demo of using your device’s camera to detect cat breeds. With today’s cameras taking incredibly detailed pictures, I hit that limit right away and had to write some code to resize the image to a smaller size. Luckily, the Gemini API has a better way of handling that, the File API. The File API # This API provides a separate method... more →
Posted in: JavaScript

Creating Visualizations in Postman

Earlier this week, I blogged about a cool Postman feature where you could use scripting to take the result of one API call and use it as a variable that is then used by a second call. For APIs that first require you to exchange credentials for an access token, this is a super useful way to make that process easier. Today I’m following up on that with another useful application of scripting – visualizations. Once again, I’ve got my coworker Ben to thank for showing me this. Let me show you an example. When working with Firefly Services and the text to image API, you get a nice JSON response back containing information about the results as well as links to your images. Here’s... more →
Posted in: JavaScript

Guess This City – Daily Challenge

Unveil the World with ‘Guess This City’: A New Daily Map-Based GameGet ready to embark on a new global adventure from the comfort of your home with the launch of ‘Guess This City,’ a new daily map-based game. Every day brings a new test of your geographical knowledge and deduction skills as you are challenged to identify hidden cities by revealing parts of a map, one click at a time.Discover Maps Mania… more →
Posted in: Interactive Maps

Dynamically Creating Variables in Postman

This may come as a shock to you, but sometimes, I don’t read the documentation for the tools I use. Sometimes, I don’t even look at all the various menu items and UI stuff for the tools I use. I know I’m probably the only one who does that and I apologize for letting down my faithful readers. I’ve used Postman for probably over ten years now. I don’t use it terribly often as I can normally whip up a quick API demo in Node in minutes, but I’ll use Postman from time to time. As you can probably guess by how I started this post, my use of Postman was very rudimentary. Heck, I’ve only recently realized the benefit of organizing requests via various collections... more →
Posted in: JavaScript
1 18 19 20 21 22 193