ColdFusion Posts Around the World
Matthew J. Clemente
A couple of weeks ago I put together a CFMl wrapper for the Claude API and blogged about it. Shortly thereafter, I got an email from Anthropic that the model I used was going to be deprecated in a month or so. Here's what it said: We're reaching out because you recently used Claude Sonnet 3.5 v2 (cl...
Matthew J. Clemente
I haven't had much of a chance to play with (or actually utilize) Claude Code, so I thought putting together a CFML wrapper for the Claude API would be a good jumping off point. My goal here was not perfection, but rather to experience a more "AI" approach to coding and to focus on the res...
Matthew J. Clemente
While digging into some potential memory issues in a Lucee container, I found myself needing to analyze a JVM heap dump. A little research indicated that Eclipse Memory Analyzer (MAT) was the way to go. But I had to jump through a few hoops to get it working on my M2 Mac. I went to the MAT download ...
Matthew J. Clemente
I recently learned about the function arraySet. It's a niche function, to be sure, but I nevertheless found that it served a useful purpose when creating arrays. To start, I'll just quote the docs, regarding what arraySet does: In a one-dimensional array, sets the elements in a specified index range...
Matthew J. Clemente
On more than one occasion I've wanted to quickly check the size of a database. Fortunately, PostgreSQL has a function for that, so we can run a query to find the answer. PostgreSQL has functions beyond counting, including dozens for system administration. Functions related to database object size ca...
Matthew J. Clemente
While there may be times you need a full-featured Slack integration, just being able to send messages to a channel can be a win for many applications. I recently needed to alert a Slack channel whenever an application was deployed, and found that using Eric Peterson's module Hyper along with Slack's...
Matthew J. Clemente
In ColdFusion applications, I tend to use the AntiSamy Java library to sanitize user-supplied input. While updating to the latest version of AntiSamy (actually, the snapshot of an upcoming release - more on that later) I documented the process, and particularly how Maven can make it easier. For a fe...
Matthew J. Clemente
I'll begin by saying that a substantial portion of this post is deeply indebted to Tony Junkes, who has blogged quite a bit about using ColdBox modules with FW/1. The approach I ended up taking is slightly different than his, so I thought it worth documenting. Background I have a number of applicati...
Matthew J. Clemente
As a quick follow-up to my last post about storing database credentials in AWS Secrets Manager, I wanted to walk through retrieving them using CFML, so you can actually use them in your application. IAM User and Permissions The first thing we'll need is AWS credentials - specifically, the access key...
Matthew J. Clemente
Today I learned that AWS Secrets Manager enables you to store the login credentials and connection information for a database in a single secret. I'm not sure how I missed this earler! Now, just to note up front, it doesn't seem like this is a new development; in fact, there's a good chance this fea...
Matthew J. Clemente
This should be a short post, on a pair of complimentary functions that I just learned: objectSave and objectLoad. I'm not sure I've fully grasped their practical utility yet, but they're certainly worth knowing. The Backstory I stumbled across objectSave while reading the code of Brian Love's functi...
Matthew J. Clemente
Just a small note here, for my own reference, and also to get myself back into the habit of blogging. I found VS Code's highlighting of matching brackets a bit distracting, so here's how I modified it to be a little less "in your face." The Problem The August 2021 release of VS Code promin...
Matthew J. Clemente
Thanks to my ignorance, PostgreSQL is an ongoing source of TILs. Today, I learned about using interval to easily select a range of time. While reviewing data from a logging table, I needed to select records from the past 30 days. On a whim, I decided to see if PostgreSQL provided any clever ways to ...
Matthew J. Clemente
File this under interesting SQL features that I just learned - you can GROUP BY and/or ORDER BY the numeric column position in your SELECT statement, rather than writing out the full column identifier. If that's unclear, an example should help clarify. For a decade (or more), I've specified column i...
Matthew J. Clemente
This post touches on two subjects - the first involves reading a range of lines from a file in ColdFusion - and the second is a question: if you have a useful CFML function, where can you share it? Reading File Lines While working on a Commandbox custom command to generate markdown documentation fro...
Matthew J. Clemente
For reasons irrelevant to this post, I wanted to run a query directly via the PostgreSQL JDBC Driver, bypassing cfquery. To be clear, up front, I do not recommend doing this and I don't know of any practical use case for it. But, because I couldn't find much online, I thought it worth documenting. W...
Matthew J. Clemente
A quick note on a very convenient PostgreSQL function that I learned today - GREATEST - which can be used when you want a database column updated only if the incoming value is greater (more recent) than the existing value in the column. I'm coming from a MS SQL Server background, so I wasn't familia...
Matthew J. Clemente
Despite 10+ years of CFML programming, I'm still stumbling across new functions. Today, it was the awkwardly named but surprisingly handy ucFirst, a Lucee-specific function for dealing with string capitalization. I'll just quote the docs, regarding what ucFirst does: Transforms the first letter of a...
Matthew J. Clemente
Two days before Thanksgiving, I decided to put together a simple way for our family to share pictures, because we couldn't be together in person. The idea: smart photo frames that everyone could text pictures to. Here's how I got it working. tldr; A Pipedream workflow parses SMS messages sent to a T...
Matthew J. Clemente
The applications I've built up to this point haven't needed to account for time zones (and for that I consider myself fairly fortunate), which is probably one of the reasons that I only just discovered that ColdFusion's date/time functions can accept a timezone parameter. Well, that's not exactly tr...
Matthew J. Clemente
Recently, I set up a demo Github account. I already had a demo GitLab account. So now I have two GitHub accounts, two GitLab accounts, and a Bitbucket account for good measure. It took me a few tries to get the multiple accounts working correctly, so these are my notes, in the event that I forget, o...
Matthew J. Clemente
During a recent live-coding session, I tried to build a website uptime monitor with Pipedream. Even with a few digressions, I managed to get most of it done within the hour, and figured that the process and platform were worth sharing. Some Pipedream Context If you're unfamiliar, Pipedream is a seve...
Matthew J. Clemente
My shell startup has felt laggy for a while, but never quite slow enough that I felt compelled to track down the cause. Until today. Today I finally put in work, managing to shave nearly a second off its load time through a few adjustments to my setup with Oh My ZSH. tldr; Virtual environment manage...
Matthew J. Clemente
Arrow functions have been around in CFML since Lucee 5 and Adobe ColdFusion 2018 (Update 5), respectively. Despite this, I only recently began trying to get comfortable with the syntax. I was surprised to find that, while Lucee added fat arrow support much earlier, Adobe ColdFusion provides more com...
Matthew J. Clemente
We recently ran into a puzzling issue with cfhttp and CommandBox 5. Requests to certain domains, such as trycf.com, would fail with Unknown host: Received fatal alert: handshake_failure, despite the domain's SSL certificate being valid. I hope this post, which digs into the somewhat unexpected sourc...
Matthew J. Clemente
Building on my previous post, which covered writing a basic custom command for the CommandBox CLI, I put together another video, detailing how to pass parameters to your command. Odds are, if you're interested in writing a custom command, you're going to need yours to handle parameters. CommandBox p...
Matthew J. Clemente
I posted a video, walking through the process of building your first CommandBox custom command. If you're not familiar with this aspect of CommandBox, I think you may be surprised how quickly you can build your own CLI commands. CommandBox enables developers to extend its functionality via CommandBo...
Matthew J. Clemente
I'm not a database guru or SQL sherpa, but from time to time I do fill the role of de facto DBA. The following are some notes and observations from a recent, successful, migration from Microsoft SQL Server to PostgreSQL. Is it everything you need to know? Absolutely not. But there are some points an...
Matthew J. Clemente
Hindsight being 20/20 makes the lesson of this post appear comically obvious, but as the underlying issue took a while to track down, I thought it worth documenting. The embarrassing TLDR; is that you should make sure that your Redis cache is appropriately sized for your session data or you might en...
Matthew J. Clemente
One of the appeals of open source software is that anyone can contribute. When you encounter a problem with an open source project, beyond simply reporting the bug, you have the means of resolving it - anyone can send a PR. Having recently gone through this process with CommandBox, I thought it migh...
Matthew J. Clemente
Well, the title feels a bit like word soup, but I think it's accurate. When I got started with Lucee, containers, and external cache providers, I blogged about using Memcached. At work, we've since shifted our stack, and now primarily use Redis for caching. This post outlines some reasons for that c...
Matthew J. Clemente
Just a quick note about generating XLSX (Excel) files with ColdFusion, which basically amounts to me regurgitating the documentation. It's a small change in code, but the reduction in spreadsheet file size can be considerable. Some Background I've been under the (mistaken) impression that when gener...
Matthew J. Clemente
I had the opportunity to present two sessions at this year's Adobe ColdFusion Summit in Las Vegas - the first on Docker Swarm, the second on CFML API wrappers. While I'd given both previously, these were updated versions - there's always room for improvement and changes in this space can happen with...
Matthew J. Clemente
Addition, subtraction, multiplication, and division. These are the four mathematical operations I was taught during my childhood education, and their operators, +, -, *, /, are very familiar. I was not taught %, the modulus operator, which I recently discovered can be quite useful and interesting in...
Matthew J. Clemente
Okay, so this is slightly embarrassing, in that I'm writing about a "feature" that was added in ColdFusion 8... so, over 11 years ago. I'm talking about the compound assignment operators: +=, -=, *=, /=, and %=. To be clear, I wasn't entirely unaware of this functionality. But while I'd us...
Matthew J. Clemente
One of my goals for the coming months is to improve my proficiency with Java; that is, to put some real knowledge behind my current patchwork understanding, pieced together over the years via trial-and-error. Before diving into Java training courses on Udemy, Youtube, etc, I wanted to make sure that...
Matthew J. Clemente
Many thanks to the (growing) team at Ortus Solutions for their tremendous work with this year's Into the Box conference. True to form, it was filled with in-depth sessions and a relentless emphasis on modernization, best practices, and advanced tooling. I've said it before - if you're a CFML develop...
Matthew J. Clemente
My goal here was to put together a script for easily setting up a Swarm on DigitalOcean. As with the previous post, I wanted to do this without relying on Docker Machine, so again, I leaned on doctl to do the heavy lifting. TL;DR: Get the Swarm Creation Script on GitHub The resulting script provides...
Matthew J. Clemente
Months ago I ambitiously began a series of posts about setting up and deploying a production Docker Swarm. Well, I intended it to be a series. I didn't actually get around to writing a second article until now, and for better or worse, this will basically serve as a revision of that first post, in w...
Matthew J. Clemente
I blogged, in two earlier posts, about installing and deploying FusionReactor Cloud to monitor CFML applications on Docker Swarm. The next step is to to configure its updated alerting system to let you know if anything is amiss. The following is a not-exactly-brief guide to FusionReactor Cloud Alert...
Matthew J. Clemente
Following my previous post about setting up FusionReactor on Docker Swarm, we encountered an issue with deployments failing to report. After a dozen or so emails with the fantastic FusionReactor support team, everything is working again. Here's what I learned. The Problem During a routine deployment...
Matthew J. Clemente
Moving a standard ColdFusion installation to Docker Swarm requires rethinking - and frequently rewiring - portions of our infrastructure. Today, that means reconfiguring how we deploy FusionReactor to monitor our applications. If you're already using FusionReactor, you know its value (and if you're ...
Matthew J. Clemente
It's not difficult to use ColdFusion spreadsheet functions (e.g. spreadsheetNew() and cfspreadsheet) in Lucee. Nevertheless, I managed to make a handful of mistakes while implementing them. I've catalogued my missteps here, along with the approach that actually worked. Adobe ColdFusion provides a nu...
Matthew J. Clemente
This will be old news - very old news - for some people. Today I learned the "other" way to add images to a Markdown document; instead of writing them inline, you can embed images reference-style. I've always written Markdown images inline:  - Giving Email a REST (slides here). This won't be a full conf...
Matthew J. Clemente
One of the issues you need to tackle when deploying Lucee containers is automating the installation of server extensions; there are a few methods, each with its own tradeoffs. To the current list of approaches, I'm adding docker-lex-install, a CommandBox module I wrote to handle this process. The Ba...
Matthew J. Clemente
This post started as an investigation of how best to extract text from a PDF; it then turned into an exploration of PDFBox, lead me down the rabbit hole of PDF sanitization, and ultimately resulted in developing pdfbox.cfc. Extracting Text from PDFs with ColdFusion A project at work required the tex...
Matthew J. Clemente
This is the first post in a series about setting up and deploying Docker Swarm for production. We'll lay the foundation for future work by using a simple shell script to set up our servers on DigitalOcean. Update - 03/04/2019: I've written an updated version of this post: Scripting Docker Host Creat...
Matthew J. Clemente
I haven't had a lot of time to blog recently. Why? In a word: Docker. At work we're moving toward a fully containerized stack, from development to production, so I've needed to spend every free minute trying to learn the ins-and-outs of container orchestration. Two initial takeaways: 1) it's still n...
Matthew J. Clemente
Ok, the title isn't entirely accurate. The process discussed here isn't so much "building" a module as "adding ColdBox functionality" to an existing ForgeBox package - boxifying it, one might say. I've never built a ColdBox application, but I've been increasingly interested in th...
Matthew J. Clemente
I was lucky enough to attend (and speak) at this year's Into the Box conference in Houston, TX. The event is organized by Ortus Solutions, the team that created CommandBox, TestBox, and all other manner of Box products. Ortus is undeniably the leader in creating cutting edge CFML tooling and feature...
Matthew J. Clemente
ForgeBox.io, in case you didn't know, is directory of CFML packages - bits of code both large and small - written and shared by the developer community to make all of our lives easier. I've written a number of open source projects hosted on Github, so I figured it was time that I began adding them t...
Matthew J. Clemente
At Adobe's ColdFusion Summit (2017), I was able to attend Brian Klaas's presentation, "Level Up Your Web Apps With Amazon Web Services." Brian is an engaging speaker - he conveyed excitement, knowledge, and real-world insights into the often overwhelming AWS ecosystem. I was particularly i...
Matthew J. Clemente
I've recently begun working on a CFML project that involves interacting with AWS Lambda. I'll be posting more on that later, but one of the helpful bits of code that came out of the project was a small function to parse Amazon Resource Names (ARNs) into their component parts. Why would you want to p...
Matthew J. Clemente
I'm flying home from my first CFSummit - what a great conference! I gave a ColdFusion-centric version of my send.Better() - Giving Email a REST presentation (slides here) in the first slot of the first day, so I was able to focus on and enjoy the rest of the sessions. A few scattered thoughts: I was...
Matthew J. Clemente
I'm speaking next month at Adobe ColdFusion Summit 2017 in Las Vegas. In preparation, I was reading the documentation for cfmail and was surprised to learn that it had a boolean debug attribute. While it might not be a hidden gem, if you're sending emails via STMP, you might find this option helpful...
Matthew J. Clemente
Admission: I've only recently started using tags to version my Git repositories. I had the (mistaken) idea that the process was difficult and never bothered learning the specifics. Working more with open source projects eventually lead to the realization that tags and versioning provided a developer...
Matthew J. Clemente
This past weekend I had the opportunity to present at NCDevCon in Raleigh, NC. The title of my session was send.Better() - Giving Email a REST. Slides from the talk are here: slides.com/mjclemente/sendbetter-ncdevcon. If you're going to Adobe ColdFusion Summit 2017 in Las Vegas this November, I'll b...
Matthew J. Clemente
My latest side project has been developing SendGrid.cfc a CFML wrapper for the SendGrid API (v3). This post isn't about the API or SendGrid.cfc though; it's about the Builder Pattern. Apparently this approach to handling complex objects is well-known in the Java world, but I had not encountered it i...
Matthew J. Clemente
This is the third in a series of posts about getting started with Docker. In the first I set up Docker on my machine; the second covered running ColdFusion on Docker (with Lucee). My next step was to tackle Adobe ColdFusion (ACF), which turned out to be easier than anticipated. Problem: There's no o...
Matthew J. Clemente
I just got Docker up and running, and now I want to use it to run some of my actual ColdFusion code. I've primarily worked with Adobe ColdFusion (ACF), but at this point, the most prominent Docker development for CFML is being done with Lucee, so I'm going to use that for my initial attempt. This po...
Matthew J. Clemente
Our team is planning on moving to Docker in the coming months. After attending a number of Docker-related sessions at cf.Objective() this past week, it seemed time to get my hands dirty and actually start working with it. The following is a painfully simple walkthrough of the steps I took to go from...
Matthew J. Clemente
Well, they say that all good things must come to an end, which turns out to be the case for Mailgun's free email address validation API, a service about which I've spoken highly in the past. In a June 27th blog post, along with new features, they announced a usage based pricing model. So, what's cha...
Matthew J. Clemente
I'm frequently digging up documentation for various CFML functions. The key, for me, is the convenience and ease with which I can integrate these lookups into my workflow. There are a few ways to do this, depending on your preferences, but I'm happy with the process I've settled on, as it provides f...
Matthew J. Clemente
What's the name of that function? The one that converts the opening numbers of a string into a numeric value? I always forget. For the record, it's val(). I probably forget the name because it's... not particularly clear or helpful in conveying its purpose. Here are the official Adobe docs and, for ...
Matthew J. Clemente
I'm making an effort, when I learn something while resolving an issue, to document the process. I'd rather not have to muddle through the haze of déjà vu trying to solve the same problem a second and third time. The writing both helps me learn and serves as a resource when I forget. This i...
Matthew J. Clemente
As evidenced by the dearth of posts, life, both personally and professionally, has been extremely busy of late. I don't see it slowing down any time in the short term. However, I wanted to document my process of moving from LastPass to 1Password, and converting my LastPass folders into 1Password tag...
Matthew J. Clemente
The TL;DR of this post, which should be readily apparent from the title, is that Mailgun provides an excellent service for email validation. Most of us don't want or need to know the details of the RFCs; we want an easy way to validate email addresses, so we can get on with building our apps. For CF...
Matthew J. Clemente
While struggling to write a different post, I procrastinated by deciding that, to boost my productivity, I needed the preview of the post to live-reload. It was actually really easy to set up (and it's very cool to use). Update - 07/17/2019: Admittedly, this is a bit late to the party, but I should ...
Matthew J. Clemente
This is just an update on the cfscript lexer for Rouge. Here's the TLDR: It's available! Want to get started? Read on. My PR was merged (back on June 14) by the incredibly gifted @jneen. So you can highlight your cfscript code snippets in Rouge v1.11.1+. If I seem excited, it's because I am - it's b...
Matthew J. Clemente
Well, I submitted by PR for adding CFScript to Rouge, so we'll see how that turns out. I only worked on CFScript - I don't have much use for tag highlighting, at present, and that kept the scope of the project more manageable. I was pretty happy with the result, though it did take more time than I h...
Matthew J. Clemente
This wasn't supposed to be long post - just a quick write-up on a helpful function that I stumbled upon. It never ceases to amaze me when I encounter an aspect of ColdFusion (function, feature, tool, etc) that's new to me, but has been around for years. This time, the function is callStackGet(), whi...
Matthew J. Clemente
We recently had the need to validate rich text input in one of our applications. In the past we've rolled our own validation, using various regex strings. While this worked, we're always looking for better ways to solve problems, which is why I was intrigued to find the isSafeHTML and getSafeHTML fu...
Matthew J. Clemente
When I started blogging with Jekyll, one of the projects that interested me was working on a CFML lexer for Rouge. It's been a while since I've written a post, so it seemed like a good time to just dive in, get my hands dirty, and see what happened. All I'm doing in this post is getting Rouge set up...
Matthew J. Clemente
There are two small projects I've been working on: salesforceiqcfc and screenshotlayercfc. They are basic, CFML API wrappers for the SalesforceIQ and Screenshotlayer.com APIs, respectively. Their benefit to me is twofold: 1) I can use the actual functionality of the APIs in my applications, and 2), ...
Matthew J. Clemente
We recently encountered a memory leak that I suspected was the result of poor var scoping, but I couldn't locate the offending code. In the past, I've used varscoper (sometimes in conjunction with CodeChecker) to locate this type of error. Both have worked, and are very good tools, but I never worke...
Matthew J. Clemente
One of the most common application requirements is outputting an arbitrary amount of data in organized rows and columns. It used to be done with tables, now it's done with Bootstrap; it looks better, but the principle is the same: output items until the row is full, then start a new one - and make s...
Matthew J. Clemente
We recently upgraded to ColdFusion 11 (I know, less than ideal timing). The process was relatively smooth because we ran ColdFusion 10 and 11 side-by-side before completing the upgrade. I don't think we took this approach when moving from ColdFusion 9 to 10, but it's actually fairly easy to do. We o...
Matthew J. Clemente
I wrote procedural CFML for a long time. Even though I've moved on to using FW/1, I'm still trying to develop the habit of "thinking MVC". Every once in a while I have an "ah ha" moment, where I realize that I've been thinking procedurally, and there's a better way to structure m...
Matthew J. Clemente
One of the most regularly occuring frustrations in development is spending time working through what seems like a complex problem, only to discover, in the end, that it was caused by something embarrassingly simple. For better or worse, sometimes that's just the way it is - the answer isn't obvious ...
Matthew J. Clemente
We're still using ColdFusion 10 in production, but we're using ColdFusion 11 for some new development (I doubt we'll use ColdFusion 2016 until it's been out in the wild for a few months.) One of the "new" features in 11 is QueryExecute, which provides a more streamlined way to run queries ...
Matthew J. Clemente
We recently migrated to Mailgun (from SES on AWS) and in general have been thrilled with the change. The API is straightforward, testing is built in, and the data available is much, much better. It's been a joy to use. We did, however, run into one issue when we made the switch. While using Amazon S...
Matthew J. Clemente
This is the final installation in my three part attempt to get up and running with Jekyll and Github Pages. Part 1 recounted my wrangling with Ruby, Part 2 outlined the missteps I took while getting Jekyll to run, and this will be my overview of Github Pages. This time, I actually read the docs. Fro...
Matthew J. Clemente
Yesterday I wrote about getting started with Jekyll, which was really just recounting my difficulties getting Ruby set up and configured correctly. Once Ruby was configured and the Jekyll gem installed, I assumed that it would be a fairly straightforward process. It wasn't. But it probably should ha...
Matthew J. Clemente
This was supposed to be a post complaining about the standards, or lack thereof, applied by ThemeForest, to the Wordpress Themes they well. As I went to write it I noticed that TinyPress.co's SSL certificate had expired, so it seemed as good a time as any to dive into Jekyll and handle this static b...
Matthew J. Clemente
I want to blog, but never actually do. So I'm starting. Using TinyPress right now, because it seemed like the quickest and cheapest way to start. Looks pretty good, if I do say so myself. Gotta start somewhere....
|