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

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

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

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

Testing Google’s New Gemini Flash Model

I’m currently at Google I/O waiting for the next session to start and decided to take a quick look at the latest Gemini model to be released, Flash 1.5. As the name implies, this is a ‘speedier’ model built to return responses quicker than other models, with the tradeoff that the results may not be as good. Like most things in life, there’s going to be tradeoffs. Gemini’s Pro 1.5 model will definitely be slower but will return better results. When and how you choose is… well that’s a good question, right? I decided to build a tool so I could play with this myself. The idea is to let me enter a prompt and have it run both Flash and Pro models and see both... more →
Posted in: JavaScript

How to Retrieve WiFi Password on Windows

Remembering the WiFi password when on a guest network is never easy. Even worse is when it’s no longer posted and someone else is asking you for it. Luckily there’s a built in Windows command to recover the password of a given WiFi network. The Shell Code Open cmd and execute the following command: netsh wlan show profile name="David Walsh's Network" key=clear The result of the command, assuming the network is found, is a long text output with a variety of information about the network. To get the see the password for the network, look under the “Security settings” heading which will look like this: Security settings ----------------- Authentication :... more →
Posted in: JavaScript

ColdFusion’s CFOAUTH Tag

This will be my third ColdFusion post in the past year. I’m not saying I’m going to continue the trend, but as I find interesting use cases, I’m going to share. Today, that involves the <cfoauth> tag that I recently had a chance to play with. About two weeks ago, an old client of mine reached out asking for help adding an OAuth flow to their CF app. I’ve covered CF and OAuth in a few posts from ten-plus years ago (part one, covering Facebook, part two, covering LinkedIn, and part three, covering Google). That code demonstrated the basics of using OAuth, which entailed: Creating your application on the platform you’ll be authenticating again, which gives you... more →
Posted in: JavaScript
1 8 9 10 11 12 87