Generating Relevant Random JSON with Chrome AI

A few weeks ago I blogged a demo where I used Chrome’s on-device AI feature to parse a "generic template language" and return random strings. If you’re so inclined (and of course you are), you can read that post here: "Creating a Generic Generative Language with Chrome AI". The idea was to give the AI model a template string that described what was random, and how it was random (this is a name, this is a number, this is a color, etc) and have the model fill in the blanks with appropriate values. At work, I’ve been digging into our platform and trying to learn as much as possible. One of the cooler features of Webflow is the CMS. You define a collection (type... more →
Posted in: JavaScript

Generating Illustrated Stories with AI

A few months ago, I built a little demo that I simply forgot to actually talk about here. A coworker was building something similar and it reminded me to take a look at the code, update it, and actually share it. This is a pretty cool example of integrating multiple different APIs to create a final product, in this case, a short story with pictures. Here’s an example: How was this built? At a high level: Google’s Gemini AI is used to generate a short story. Adobe’s Firefly Services is used to generate the images. Adobe’s Acrobat Services is used to turn the text into a PDF. That’s the high level, now let’s get into the nitty-gritty. Generating a Story To... more →
Posted in: JavaScript

Legacy String Methods for Generating HTML

I’m always really excited to see new methods on JavaScript primitives. These additions are acknowledgement that the language needs to evolve and that we’re doing exciting new things. That being said, I somehow just discovered some legacy String methods that you probably shouldn’t use but have existed forever. Let’s take a look! These legacy string methods take a basic string of text and wrap it in a HTML tag of the same name: "Hello".big() // "<big>Hello</big>" "Hello".blink() // "<blink>Hello</blink>" "Hello".bold() // "<b>Hello</b>" "Hello".italics() // "<i>Hello</i>" "Hello".link("https://davidwalsh.name") // "<a... more →
Posted in: JavaScript