The Return of the Comment(s) / / No Comments In the twenty plus years this blog has been around, I’ve had various different comment systems. Initially, I simply stored them in a database (this blog used to be powered by ColdFusion), but eventually moved to Disqus. I had a pretty huge amount of comments and was generally OK with the service, but eventually, folks simply stopped commenting. I then made the decision to simply kill off the integration. I wrote some scripts to get my data, stored them as flat files, and you can still see the old comments on posts that had them. About a year or so I added in Webmentions, which works ok, but doesn’t really feel the same. After some time thinking about it, I decided maybe its time to... more → Posted in: JavaScript Tagged with: Comments, Return
Function Calling and GenAI / / No Comments I love when I work on one demo, hit an issue, discover something else and get joyfully distracted into learning something completely different. In this case, it was a suggestion to help with an issue I was having with output from a prompt, and while it wasn’t a good solution for what I was doing, it was an eye-opening look at a really cool feature of Generative AI – Function Calling. Now, I’m new to GenAI, and new to this particular feature having been introduced to it a bit less than twenty-four hours ago. I know it’s supported by Google AI APIs as well as OpenAI and a quick search around other offerings seems to imply it’s a universal thing. I want to give a quick... more → Posted in: JavaScript Tagged with: Calling, Function, GenAI
My 2023 / / No Comments Happy New Year (well almost) my fabulous readers. Typically at the end of the year, I like to take stock of what I accomplished through the year and share it in one last blog post. I honestly don’t expect anyone to actually read these summaries, but they help me determine what I did well and what I didn’t accomplish over the year while figuring out what I want to adjust for next year. So here’s how I did in 2023. Writing # My goal for the blog is consistent, useful, helpful, and fun posts. My publishing ‘plan’ is one post a week for 52 posts a year. Counting this post, I published 118 posts which I’ll take as a big ole win. My traffic, according to Netlify,... more → Posted in: JavaScript Tagged with: 2023
Using Generative AI to Detect Cat Breeds / / No Comments Let’s be honest, what other use is there for generative AI than working with cats? If you read my previous post on Google’s Gemini AI launch, you may have seen my test prompts asking it to identify the kind of cat shown in a picture. I decided to turn this into a proper web application as a real example of the API in action. Here’s what I came up with. The Front End # For the front end, I decided to make use of a native web platform feature to access the user’s camera via a simple HTML form field. By using capture="camera" on an input tag, you directly get access to the device camera. There are more advanced ways of doing this, but for quick and simple, it works... more → Posted in: JavaScript Tagged with: Breeds, Detect, Generative, using
AutoGrow Textareas with CSS / / No Comments As the demands of the web change and developers experiment with different user experiences, the need for more native language improvements expands. Our presentation layer, CSS, has done incredibly well in improving capabilities, even if sometimes too slow. The need for native support for automatically expanding textarea elements has been long known…and it’s finally here! To allow textarea elements to grow vertically and horizontally, add the field-sizing property with a value of content: textarea { field-sizing: content; // default is `fixed` } The default value for field-sizing is fixed, signaling current behavior. The new behavior, content, will expand as much as possible.... more → Posted in: JavaScript Tagged with: AutoGrow, Textareas
An Image Dialog Web Component / / No Comments A lot of the talk (well, on Mastodon at least) lately concerning web components has been on "HTML Web Components". The idea is that web components can progressively enhance "regular" HTML in the DOM instead of completely blowing it away with the Shadow DOM. (You can find a deeper discussion of this in Jim Nielsen’s blog post.) This is something that’s been on my mind for a while now as well and I’ve kept my eyes open for opportunities to build web components that enhance, not replace, content. With that in mind, I built a really simple component that does something fun. We’ve all seen sites that use JavaScript to provide a thumbnail and detail view... more → Posted in: JavaScript Tagged with: Component, Dialog, Image
Google Gemini and AI Studio Launch / / No Comments While it feels like just yesterday I first blogged about Google’s PaLM APIs and MakerSuite, it was actually over two months ago, and of course, GenAI offerings are iterating and improving at lightning speed. In the past week, Google has announced Gemini, their new generative AI model. Naturally, I was curious about the API aspect of this and took a quick look. MakerSuite rebranded as AI Studio # First off, the web UI (which I reviewed back in my first post) has been renamed to the generic and boring, but probably more enterprise and appropriate, AI Studio. Along with that, when creating new prompts, it will default to use Gemini models. (You can still select PaLM if you want.) Another change…... more → Posted in: JavaScript Tagged with: Gemini, Google, launch, Studio
The Twelve (Generative) Days of Christmas / / No Comments I tend to have a lot of silly ideas. Not useful ideas. Not good ideas. Silly ideas. Randomly yesterday I was thinking about the Twelve Days of Christmas song. If you aren’t familiar with it, it starts off with a gift for one day, then repeats and adds a second day, and so on and so on. The gifts are: partridge in a pear treetwo turtle dovesthree French hensfour calling birdsfive gold ringssix geese a-layingseven swans a-swimmingeight maids a-milkingnine ladies dancingten lords a-leapingeleven pipers pipingtwelve drummers drumming I thought – what if I took each of these phrases and dropped them into an AI image generator? I did, and the results were… kinda fun. Before I show... more → Posted in: JavaScript Tagged with: Christmas, Days, Generative, Twelve