Creating a Generic Generative Template Language in Google Gemini

I’ve been a fan of ‘random text’ for some time. "Random text" is a bit vague, but to me the idea of using code to generate random stories, or even snippets, is fascinating. Back in April, I blogged about how I created short dragon-based stories. It took a generic string: A #adjective# dragon lives #place#. She #verb# her hoard, which consists of a #number# of #thing#, #number# of #thing#, and #number# of #thing#. She feels #feeling#. And created a story by replacing the pound-wrapped tokens with real words. I used a couple of different tools to build this, but the core one was a cool little Node library named random-word-slugs. It’s a powerful random word library... more →
Posted in: JavaScript

Creating a Content Assistant with Gemini and GenAI

One of the use cases for generative AI that I’ve discussed before is the idea of using the tool to aid in the writing process. I’m not talking about creating content so much as creating suggestions and providing feedback about the content you yourself have created. This past weekend I worked on a "general purpose" tool with this in mind and thought I’d share it to get your feedback. ("You" being the smart readers of this blog who keep me honest when I show something stupid. 😉 The Application # The application itself is rather straightforward. It asks two questions – first, what are you trying to accomplish with your writing and what are the desired... 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

Creating Human-Readable Summaries of Data with Google PaLM Generative AI

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

Creating a Blackjack Game with Alpine.js and the Deck of Cards API

Some time ago I ran across a pretty fascinating service, the Deck of Cards API. This API handles everything imaginable related to working with decks of cards. It handles creating a shuffled set of cards (containing one or more decks), dealing out a card (or cards), and even reshuffling. Even better, it includes card images you can use if you don’t want to find your own: It’s an incredibly feature-filled an API and best of all, it’s completely free. No need for even a key. I’ve known about this API for a while and have contemplated building a card game with it, but realized that games can quickly go from simple to fairly complex. In fact, my friends strongly urged me not... more →
Posted in: JavaScript

Creating Bootstrap WebC Components in Eleventy

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
1 2