Google Gemini as Your Dungeon Master / / No Comments So this is absolutely just another example of me playing around too much, but I had to share. As I mentioned in my post yesterday, Google’s AI Studio now supports uploading files and working with them in your prompt. Today I decided to give the Chat interface a try as I hadn’t yet played with it. On a whim, I googled for "dungeons and dragons rules PDF" and… well, you won’t believe what happened next. (Sorry, I couldn’t resist.) First off, the most important thing to note if you want to test with PDFs, ensure that they are OCRed. Right now AI Studio does not handle that well, but it should be corrected in the future. My Google search turned up the PDF here,... more → Posted in: JavaScript Tagged with: Dungeon, Gemini, Google, master
The Sad State of Local News 2023 / / No Comments Northwestern University’s The State of Local News Outlook is an interactive map which visualizes the number of surviving local newspapers in every county in the United States. On this local news map individual counties are clored to show whether the county has 0, 1 or 2 or more news outlets. The data shown on the map can also be filtered to show the number of local number of newspapers, Maps Mania… more → Posted in: Interactive Maps Tagged with: 2023, local, News, State
How to Override width and height HTML attributes with CSS / / No Comments One of the HTML elements that frequently comes into collision with CSS is the img element. As we learned in Request Metrics’ Fixing Cumulative Layout Shift Problems on DavidWalshBlog article, providing image dimensions within the image tag will help to improve your website’s score. But in a world where responsive design is king, we need CSS and HTML to work together. Most responsive design style adjustments are done via max-width values, but when you provide a height value to your image, you can get a distorted image. The goal should always be a display images in relative dimensions. So how do we ensure the height attribute doesn’t conflict with max-width values? The answer... more → Posted in: JavaScript Tagged with: attributes, height, HTML, Override, width
Looking at the JavaScript Promise Collection Methods / / No Comments Let me begin by saying that "Promise Collection Methods" is not something I’ve seen mentioned elsewhere, but is my own way of referring to the various methods of the Promise API that work with multiple promises. They are: Promise.all Promise.allSettled Promise.any Promise.race I’ve used Promise.all many times in the past, and I was aware of the other methods but had not taken the time to actually build a demo of them. This weekend I changed that. After spending a few hours in Sanctuary grinding my Necro character, I put down the controller and picked up the laptop. Here’s what I built. As a note, everything shown here works in modern browsers, but you can check MDN... more → Posted in: JavaScript Tagged with: collection, JavaScript, Looking, methods, promise
The Most Controversial Interactive Map / / No Comments One of the earliest popular uses of the Google Maps API was Gawker Stalker. The now defunct Gawker Stalker interactive map tracked the movements of famous celebrities thanks to the detailed stalking carried out by Gawker and their readers. Now similar concerns are being raised regarding potential privacy infringements related to Jack Sweeney’s TheAirTraffic, particularly involving the Maps Mania… more → Posted in: Interactive Maps Tagged with: controversial, Interactive, most
Detect Caps Lock with JavaScript / / No Comments Anyone is capable of having their caps lock key on at any given time without realizing so. Users can easily spot unwanted caps lock when typing in most inputs, but when using a password input, the problem isn’t so obvious. That leads to the user’s password being incorrect, which is an annoyance. Ideally developers could let the user know their caps lock key is activated. To detect if a user has their keyboard’s caps lock turn on, we’ll employ KeyboardEvent‘s getModifierState method: document.querySelector('input[type=password]').addEventListener('keyup', function (keyboardEvent) { const capsLockOn = keyboardEvent.getModifierState('CapsLock'); if (capsLockOn)... more → Posted in: JavaScript Tagged with: Caps, Detect, JavaScript, Lock
Where to Watch April’s Solar Eclipse / / No Comments On April 8, 2024 people across large parts of the USA will be able to see a total solar eclipse. If it isn’t cloudy.In 1999 I traveled to France to experience a total solar eclipse. Unfortunately the experience was ruined slightly by overcast skies. What made it even more galling was to discover that a friend of mine had traveled independently from me and had a cloudless view of the eclipse Maps Mania… more → Posted in: Interactive Maps Tagged with: April's, Eclipse, Solar, Watch
– First Episode / / No Comments Just a quick note to share that today I did my first episode of the <Code><Br> show. I had a great audience with some great questions and comments. My next show will be in two weeks and I hope to see you there! Raymond Camden… more → Posted in: JavaScript Tagged with: Episode, first