Learn about the Photoshop API Next Week / / No Comments Next week, Tuesday August 8 at 11AM CST, I’ll be giving a free, online presentation at CFE.dev on "Automating Image Workflows with Photoshop APIs". Here’s more information from the event description: Inarguably, Photoshop dominates the professional image editing software world. But did you know that many of the capabilities of Photoshop can be added to your own applications via Adobe’s Photoshop APIs? In this session, Raymond Camden will show you how to add image automations including modifying and enhancing images with powerful filters using the Photoshop APIs. If you can’t make it, just watch the recording later, and reach out with any questions. Photo by Glenn... more → Posted in: JavaScript Tagged with: about, Learn, Next, Photoshop, Week
ChatGPT via WYSIWYG (Sponsored) / / No Comments Artificial intelligence applications have hit like a massive wave over this past year, with ChatGPT being the most prominent. ChatGPT can take any written command and suggest content to match. What better than having the power of AI content creation than doing so within your own WYSIWYG editor! That’s what Froala can provide you — instant content creation with the power and intelligence of ChatGPT AI! Quick Hits The ChatGPT plugin can be installed in your WYSIWYG editor Type a command, highlight that text, click the ChatGPT button, and wait for the response! Help with content creation makes the written experience more enjoyable and the generated content more creative Easy to implement... more → Posted in: JavaScript Tagged with: ChatGPT, Sponsored, WYSIWYG
Integrating Acrobat Services with ColdFusion / / No Comments 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 Tagged with: Acrobat, ColdFusion, Integrating, Services
URL.canParse / / No Comments 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 Tagged with: URL.canParse
JavaScript closest / / No Comments 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 Tagged with: closest, JavaScript
Want to learn Alpine.js? / / No Comments 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 Tagged with: Alpine.js, Learn, want
Creating a Blackjack Game with Alpine.js and the Deck of Cards API / / No Comments 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 Tagged with: Alpine.js, Blackjack, Cards, creating, Deck, Game
JavaScript: Reverse Arrays / / No Comments Manipulating data is core to any programming language. JavaScript is no exception, especially as JSON has token over as a prime data delivery format. One such data manipulation is reversing arrays. You may want to reverse an array to show most recent transactions, or simple alphabetic sorting. Reversing arrays with JavaScript originally was done via reverse but that would mutate the original array: // First value: const arr = ['hi', 'low', 'ahhh']; // Reverse it without reassigning: arr.reverse(); // Value: arr (3) ['ahhh', 'low', 'hi'] Modifying the original array is a legacy methodology. To avoid this mutation, we’d copy the array and then reverse it: const reversed = [...arr].reverse();... more → Posted in: JavaScript Tagged with: Arrays, JavaScript, Reverse