Mapping with Leaflet / / No Comments If you missed my <Code><Br> episode earlier this week you missed (imo) a great episode. I’ll share a link to the video at the end, but I spent the session raving about how great the Leaflet JavaScript library is for maps. I had it on my list to look into for a few months now and while having a layover recently I took the time to dig into it. I was – blown away. I’ve got a lot of experience over the years working with maps on the web. I really dig Google Maps, both the JavaScript library and APIs, and I spent some time as a developer evangelist for HERE helping others learn about their offerings. I’m obviously a bit biased but I really dug their offerings as... more → Posted in: JavaScript Tagged with: Leaflet, Mapping
Real-Time Sentiment Analysis on Device with AI in Chrome / / No Comments Last week, I took a look at Chrome’s GenAI implementation in the browser. What I found was interesting, and rough, but possibly something that could be incredibly useful in the future. I’ve been thinking about it more the last few days. First off, if this feature interests you, there is an early preview program you can sign up for that gives you access to a mailing list containing docs, announcements, and more information. I’ve done that and it was a relatively quick process. There are already cool things I’ve seen there that I want to dig into soon, but today I wanted to share a little experiment. This too does not work terribly well yet, but I think the idea has merit... more → Posted in: JavaScript Tagged with: Analysis, Chrome, device, realtime, Sentiment
Another Web Component – Table Compressor / / No Comments Earlier this week I was browsing a site that showed a tabular list of data. It initially showed something like ten rows and had a clickable item that showed the rest of the data. I thought I’d whip up a quick web component that mimicked this functionality. My thinking was that you would wrap a regular HTML table (much like my table sorting component) and the component would truncate and add the ‘click to expand’ logic. Now, to be clear, this still means the user is downloading the entire set of data, but visually it would take up less space until the user selects to show the rest of the data. Let me share the component here and then I’ll explain how it works: class CompressTable... more → Posted in: JavaScript Tagged with: Another, Component, Compressor, table
Links For You (8/18/2024) / / No Comments Woot, welcome to football season! Ok, preseason, but I am beyond excited to watch my Saints play later today and, hopefully, look halfway decent. My wife and I are both big football fans and the start of the season is always a happy occasion. This past week I traveled to Atlanta to give a lab on Adobe’s Firefly Services APIs which went well, and I get to do it again next week in New York City. I hope your week goes well, and here are some interesting links for you to enjoy. Migrating from Netlify to Cloudflare In this post, Sia Karamalegos discusses how she migrated her site from Netlify to Cloudflare. This was done primarily due to Cloudflare releasing a new service to block AI crawlers,... more → Posted in: JavaScript Tagged with: 8/18/2024, links
Setting Dynamic Objects Keys in JavaScript / / No Comments It’s always a good day when you get pleasantly surprised by JavaScript, even more so when you find that it’s a feature that’s been around for a while (ES6, which according to Google was standardized in June of 2015). Earlier today I saw some syntax that didn’t look quite right to me. Here’s a simple example of it: let type = 'name';let person = { [type]:'Ray'} Specifically, the thing that surprised me was this portion: [type]:'Ray' If you console.log the code above, you get: { name: 'Ray' } And then it makes sense. This syntax allows you to set a dynamic key in an object literal, much like: person[type] = 'Ray'; Apparently, this has been around for nearly ten... more → Posted in: JavaScript Tagged with: dynamic, JavaScript, Keys, Objects, setting
A Quick Look at AI in Chrome / / No Comments Google announced a while back their intent to experiment with generative AI in the browser itself. Personally, I think this could be a really good idea, but I’m really unsure as to how many other vendors would support it. With Edge being a Chromium product, and Microsoft being pro-GenAI, it seems like a safe bet it would support it. Safari and Firefox… I honestly feel like they probably never would. That being said, initial support landed in Chrome Canary (the bleeding edge version of Chrome) and I thought I’d take a quick look. Here’s what I found. Setting it Up To test this new feature, you need either Chrome Canary or Dev. Enabling support requires tweaking two flags... more → Posted in: JavaScript Tagged with: Chrome, Look, Quick
Next Code Break – August 6 / / No Comments Hey folks, earlier last month, I mentioned a tweak to my <Code><Br> schedule, and originally I was going to have one today, but that has been pushed out to August 6th. You can find out more here: Hacking Arduino Hardware as a Noob Pt. 2 My plan is to continue showing Arduino/web integration and I’ve got an interesting bug to share. (I love it when I make mistakes that are good lessons!) I hope to see you there! Raymond Camden… more → Posted in: JavaScript Tagged with: August, Break, code, Next
How to Add a Header to a curl Request / / No Comments curl is one of those great utilities that’s been around seemingly forever and has endless use cases. These days I find myself using curl to batch download files and test APIs. Sometimes my testing leads me to using different HTTP headers in my requests. To add a header to a curl request, use the -H flag: curl -X 'GET' \ 'https://nft.api.cx.metamask.io/collections?chainId=1' \ -H 'accept: application/json' \ -H 'Version: 1' You can add multiple headers with multiple -H uses. Header format is usually [key]: [value]. The post How to Add a Header to a curl Request appeared first on David Walsh Blog. David Walsh Blog… more → Posted in: JavaScript Tagged with: curl, Header, Request