Using Asynchronous Content in Leaflet Popups

Today in my <Code><Br> stream (I’ll share a link to the video at the bottom), I spent some time digging into Leaflet and worked on a demo that made use of the National Parks Service API. This is a fun API I’ve used many times in the past, especially at my last job at HERE. For the stream today, I wanted to build the following: Create a map that loads a geojson file of NPS parks. The geojson file contains the code and name for each park. On clicking one of the markers, use the NPS API to get more information about the park. In general, I’ve found everything in Leaflet to be stupid easy, but this particular aspect turned out to be a bit more difficult, which of course... more →
Posted in: JavaScript

Using AI to Roast Your Photos

Chalk this up as another of my "this is probably not a good idea, but it’s fun" blog posts. A few weeks back my buddy and ColdFusion Evangelist Mark Takata shared a fun little thing he did with GenAI – using it to roast himself. That immediately set me off on a quest to see just how much fun I could have with the idea. Now, to be clear, I do not like mean people. But having a disembodied set of code routines roast me? Sounds perfect. Back in December last year, I built an experiment where I used the device camera on a mobile web app and asked Google Gemini what kind of cat breed was in the picture: Using Generative AI to Detect Cat Breeds That experiment worked really well... more →
Posted in: JavaScript

Using the Chrome AI Summarizer (Early Look)

I’ve looked at Chrome’s on-device GenAI development a few times now, and as a feature it is moving pretty fast. In fact, that first post and my follow up both don’t work anymore due to the API changing. I’m fine with that as I knew it was a bleeding edge feature, but I just want to warn folks ahead of time that everything you see here may, no, will change, probably a lot. As before though, I’m keep getting more and more excited about the possibilities here. I’m still not certain this will see the light of day (in mainline Chrome) or expand out to other browsers, but it’s quite interesting. Most recently, Google has added three new APIs to the feature: A... more →
Posted in: JavaScript

Using PDF Content with Google Gemini – An Update

Way back in March of this year, I took a look at using Google’s Gemini APIs to analyze PDF documents ("Using PDF Content with Google Gemini"). At the time, the Gemini API didn’t support PDF documents, so I made use of our (Adobe) PDF Extract service to get the text content out from the document. This "worked" but was possibly less than ideal as my "glom all the text together" approach didn’t really represent the PDF well. The PDF Extract API returns information about text context (like if it is a header for example), but my method ignored that. I’m happy to share that Gemini now supports PDF files natively. Let’s take a look at how this... more →
Posted in: JavaScript

Using CSV Data with Leaflet

As I continue to play with, and really freaking enjoy Leaflet, I thought it would be interesting to show a demo of using CSV data with it. This also coincides with an interesting dataset I got from the Data is Plural newsletter, a collection of datasets covering just about any topic you can imagine. A few weeks back, they shared ancient shipwrecks covering the years from 1500 BC to 1500 AD. I know, that’s a bit random, but I thought it was kinda cool. The dataset covers near two thousand unique shipwrecks and includes information, at times, about the cargo that was being carried. I thought this would be fun to map, and here’s how I did it. Working with CVS Disregarding the map, the... more →
Posted in: JavaScript

Quick Example using Azure’s Node.js SDK for Signed URLs

Way back in June (wait, that’s only two months ago?) I wrote up a blog post showing how to use the AWS SDK for Signed URLs: "Quick example using AWS Node.js SDK V3 for Signed URLs". The idea for this was to cover a very specific set of functionality I needed to use along with Adobe’s Firefly Services. Specifically my needs are: Create a readable URL for a cloud storage asset Create a writable URL for a cloud storage asset And on top of that – also I needed to upload directly to cloud storage. I worked with Azure Storage Blob SDK and came up with the following functions. Honestly, use this with a grain of salt as it "worked for me", but I can’t make... more →
Posted in: JavaScript

Scraping Recipes Using Node.js, Pipedream, and JSON-LD

It’s pretty well known now that most, if not all, recipes on the internet are 90% crap and 10% actual recipe, at best. Obviously, there are outliers of course and obviously, if you are sharing your recipes online you are free to do so as you see fit, but speaking for myself, when I click a link to a recipe my assumption is that I’m going to have to "work" to figure out where the actual details are amongst the humorous backstories and other tidbits that don’t actually tell you how to make what you’re trying to make. That’s why I love apps like Saffron. Not only is it incredibly minimal and laser-focused on recipes, it has an incredibly good "recipe... more →
Posted in: JavaScript

Using JSON Schema with Google Gemini

Back about a month ago, I wrote up a post on how to generate JSON results using Google Gemini, "JSON Results with Google Gemini Generative AI API Calls". While you should read that post first, the process basically boiled down to: Setting the response type of the result to JSON. Without this, Gemini will return JSON but encoded in Markdown. Using a System Instruction to give directions on the "shape" of the JSON, i.e., use this key and that key. While these techniques work well, recently yet another feature was added that makes this even better, JSON schema support. JSON Schema is an abstract way to define the shape of JSON and can be really useful in validation. The website... more →
Posted in: JavaScript
1 2 3 4 8