Integrating Acrobat Services with ColdFusion

Last week I shared a look at how to integrate the Adobe Photoshop API with ColdFusion, and that got me itching to see how difficult it would be to do the same with our Acrobat Services. While ColdFusion has native PDF features built-in, I think there are aspects of the platform that may be of use to CF developers. The Acrobat Services Platform # Let’s start by briefly describing what Acrobat Services are. At a high level, they’re all about document management via APIs. Broadly the services are categorized like so: PDF Services – this is the "catch-all" bucket of services that do simple things like converting to and from PDFs, splitting, merging, and so forth. This... more →
Posted in: JavaScript

The National Stereotypes Maps – Part Two

Buzzfeed has started a new mapping trend with their AI generated images of state stereotypes. Last week Buzzfeed asked a generative AI image model to create a photograph of a person from each U.S. state, as typically perceived by a European. You can view the results in the post This is What Europeans Think of Us. I was inspired by the Buzzfeed post to create my own National Stereotypes Map. To Maps Mania… more →
Posted in: Interactive Maps

URL.canParse

Parsing of URLs on the client side has been a common practice for two decades. The early days included using illegible regular expressions but the JavaScript specification eventually evolved into a new URL method of parsing URLs. While URL is incredibly useful when a valid URL is provided, an invalid string will throw an error — yikes! A new method, URL.canParse, will soon be available to validate URLs! Providing a malformed URL to new URL will throw an error, so every use of new URL would need to be within a try/catch block: // The correct, safest way try { const url = new URL('https://davidwalsh.name/pornhub-interview'); } catch (e) { console.log("Bad URL provided!"); } // Oops,... more →
Posted in: JavaScript

Which Country Most Resembles Your Country?

The political scientist Anders Sundell has posted a Twitter thread which reveals “the countries that look the most like each other”. For example (according to Anders)  the country which most resembles the United States is Saudi Arabia.  According to the text on each country comparison an “algorithm checked the shapes of all countries in order to find the most similar shapes. All countries were Maps Mania… more →
Posted in: Interactive Maps

JavaScript closest

When it comes to finding relationships between elements, we traditionally think of a top-down approach. We can thank CSS and querySelector/querySelectorAll for that relationship in selectors. What if we want to find an element’s parent based on selector? To look up the element tree and find a parent by selector, you can use HTMLElement‘s closest method: // Our sample element is an "a" tag that matches ul > li > a const link = document.querySelector('li a'); const list = a.closest('ul'); closest looks up the ancestor chain to find a matching parent element — the opposite of traditional CSS selectors. You can provide closest a simple or complex selector to look upward... more →
Posted in: JavaScript

Want to learn Alpine.js?

For the past two weeks or so, I’ve been releasing videos on YouTube all about learning Alpine.js. Each video is relatively short (although longer than a Tiktok video) and can be quickly consumed, with the entire playlist coming in under an hour. Each video has links to CodePens that let you immediately play with the concepts I cover. I really like Alpine (as you can see by many other posts on the topic) as it’s an incredibly simple, and practical, JavaScript framework. There’s no build process, no hundreds of megabytes of download, and it’s something you can pick up rather quickly, as I hope my video series demonstrates. Check it out, leave me a comment, and let me know... more →
Posted in: JavaScript

Divorced, Befriended, Married or Died

Madrid’s Almendra Central is an island of bachelors surrounded by a sea of married couples. Spanish newspaper El Confidencial has used 2021 census data to map out whether there are more single people or married couples in every census tract in Spain. An interactive map in the paper’s Singles in Your Area, Street by Street colors every neighborhood in the country depending on whether the Maps Mania… more →
Posted in: Interactive Maps

Creating a Blackjack Game with Alpine.js and the Deck of Cards API

Some time ago I ran across a pretty fascinating service, the Deck of Cards API. This API handles everything imaginable related to working with decks of cards. It handles creating a shuffled set of cards (containing one or more decks), dealing out a card (or cards), and even reshuffling. Even better, it includes card images you can use if you don’t want to find your own: It’s an incredibly feature-filled an API and best of all, it’s completely free. No need for even a key. I’ve known about this API for a while and have contemplated building a card game with it, but realized that games can quickly go from simple to fairly complex. In fact, my friends strongly urged me not... more →
Posted in: JavaScript
1 38 39 40 41 42 190