Matthew J. ClementeAlways trying to be better2022-07-27T00:00:00Zhttps://blog.mattclemente.com/Matthew J. ClementeTIL: Use arraySet to Initialize an Array of a Specific Size2022-07-27T00:00:00Z2022-07-27T00:00:00Zhttps://blog.mattclemente.com/2022/07/27/til-cfml-arrayset/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 to a value. Useful for initializing an array after a call to arrayNew. As the docs helpfully point...How Large Is My PostgreSQL Database?2022-05-21T00:00:00Z2022-05-21T00:00:00Zhttps://blog.mattclemente.com/2022/05/21/how-large-is-postgresql-database-query/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 can be found in the documntation here in Table 9.92. At first glance, it looks like the way to answer...Quick and Dirty CFML Slack Notifications with Hyper2022-05-12T00:00:00Z2022-05-12T00:00:00Zhttps://blog.mattclemente.com/2022/05/12/cfml-slack-incoming-webhook-hyper/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 Incoming Webhooks did the trick nicely. I'll share how to do this with a FW/1 application - just...On Using the Latest Version of AntiSamy with ColdFusion2022-04-13T00:00:00Z2022-04-13T00:00:00Zhttps://blog.mattclemente.com/2022/04/13/using-and-upgrading-antisamy-with-coldfusion/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 few years the OWASP AntiSamy project appeared to be strictly in maintenance mode,[1] but development...An Approach to Using Hyper, qb, Logbox, and Other ColdBox Modules with FW/12022-02-25T00:00:00Z2022-02-25T00:00:00Zhttps://blog.mattclemente.com/2022/02/25/qb-hyper-logbox-modules-with-fw1/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 applications using FW/1; while not the most popular ColdFusion framework, I appreciate its relative...Retrieving Database Credentials from AWS Secrets Manager with CFML2022-01-17T00:00:00Z2022-01-17T00:00:00Zhttps://blog.mattclemente.com/2022/01/17/connecting-to-aws-secrets-manager-cfml/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 ID and secret key of an IAM user with permissions to retrieve a secret. AWS provides documentation...TIL: Storing (non-RDS) Database Credentials in AWS Secrets Manager2022-01-12T00:00:00Z2022-01-12T00:00:00Zhttps://blog.mattclemente.com/2022/01/12/til-aws-secrets-manager-database-access/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 feature has been available since Secrets Manager was released - somehow I didn't see it earlier....TIL: objectSave() and objectLoad() for Complex Data Storage, Transport, and Manipulation2021-10-01T00:00:00Z2021-10-01T00:00:00Zhttps://blog.mattclemente.com/2021/10/01/til-cfml-objectsave-objectload/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 function to hash any ColdFusion type; it generates unique identifiers for CFML variables by breaking them...Adjusting the Color of VS Code's Built In Bracket Colorization2021-09-25T00:00:00Z2021-09-25T00:00:00Zhttps://blog.mattclemente.com/2021/09/25/adjust-bracket-highlight-color-vscode/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 prominently featured its new, high performance bracket colorization. It seemed worthwhile to switch to...TIL: The Easiest Way to Select the Last 30 Days (or Any Interval) in PostgreSQL2021-05-18T00:00:00Z2021-05-18T00:00:00Zhttps://blog.mattclemente.com/2021/05/18/postgresql-select-date-range/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 do this. My searches lead me to learn about a new data type: interval.[1] Here's a link to the docs,...Group By or Order By Column Position in a SQL Query2021-05-11T00:00:00Z2021-05-11T00:00:00Zhttps://blog.mattclemente.com/2021/05/11/sql-group-order-by-column-position/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 identifiers in my queries when grouping and/or ordering, like so: SELECT extract(year FROM...Reading Specific Lines from a File with CFML (and a Question)2021-04-23T00:00:00Z2021-04-23T00:00:00Zhttps://blog.mattclemente.com/2021/04/23/reading-file-lines-with-coldfusion-cfml-snippets/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 from CFCs, I needed to read a range of lines from the file being processed. Specifically, there were...Use the PostgreSQL JDBC Driver Directly with ColdFusion2021-04-07T00:00:00Z2021-04-07T00:00:00Zhttps://blog.mattclemente.com/2021/04/07/postgresql-jdbc-driver-coldfusion/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. With Lucee Here's the approach I took, using the latest stable version of Lucee CFML (5.3.7+48)....PostgreSQL - Only Update If Greater Than2021-03-22T00:00:00Z2021-03-22T00:00:00Zhttps://blog.mattclemente.com/2021/03/22/postgresql-greatest/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 familiar with GREATEST / LEAST, which apparently are available in most other database engines, though they...TIL: ucFirst() for Word Casing in Lucee CFML2021-03-02T00:00:00Z2021-03-02T00:00:00Zhttps://blog.mattclemente.com/2021/03/02/til-cfml-ucfirst/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 string to uppercase or the first letter of each word, and optionally lowercase uppercase...How Our Family Uses SMS and Smart Picture Frames to Connect During Remote Holidays2020-12-22T00:00:00Z2020-12-22T00:00:00Zhttps://blog.mattclemente.com/2020/12/22/sharing-pictures-sms-smart-frame/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 Twilio phone number, extracting the pictures and then using SendGrid to email them to the dedicated...TIL: The Timezone parameter in CFML Date/Time Functions2020-11-30T00:00:00Z2020-11-30T00:00:00Zhttps://blog.mattclemente.com/2020/11/30/til-cfml-datetimeformat-timezone/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 true. Both Adobe ColdFusion (10+) and Lucee have a dateTimeFormat function, which can optionally...A Note on Misconfiguring my SSH Config When Setting Up Two Github Accounts2020-09-15T00:00:00Z2020-09-15T00:00:00Zhttps://blog.mattclemente.com/2020/09/15/multiple-github-accounts-wildcard-ssh-config-identityfile/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, or need to set it up again. tldr; You should explicitly list all Git Hosts in your ~/.ssh/config. If...Building a Basic Uptime Monitor with Pipedream2020-09-06T00:00:00Z2020-09-06T00:00:00Zhttps://blog.mattclemente.com/2020/09/06/pipedream-uptime-monitoring/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 severless platform with a particular focus on making it easy for developers to integrate with external...Speeding Up My Shell (Oh My Zsh)2020-06-26T00:00:00Z2020-06-26T00:00:00Zhttps://blog.mattclemente.com/2020/06/26/oh-my-zsh-slow-to-load/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 managers (nvm, rbenv, jenv, etc) are the most common culprits for a slow loading terminal, and there are a...Fat Arrow Function Support in Lucee 5 and Adobe ColdFusion 20182020-06-04T00:00:00Z2020-06-04T00:00:00Zhttps://blog.mattclemente.com/2020/06/04/arrow-functions-in-adobe-coldfusion-and-lucee/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 complete support for the syntax. On the Arrow Function Syntax Whether you like its succint nature, or...CFHTTP and SSL issues with CommandBox 52020-05-23T00:00:00Z2020-05-23T00:00:00Zhttps://blog.mattclemente.com/2020/05/23/commandbox-5-cfhttp-ssl-issues/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 source of them problem, is helpful to anyone else who might encounter the error. tldr; Try adding the...Passing Parameters to CommandBox Custom Commands2020-03-14T00:00:00Z2020-03-14T00:00:00Zhttps://blog.mattclemente.com/2020/03/14/passing-parameters-to-commandbox-custom-commands/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 provides a number of parameter-specific conventions and features, which serve the dual-purpose of...Getting Started with CommandBox Custom Commands2020-03-02T00:00:00Z2020-03-02T00:00:00Zhttps://blog.mattclemente.com/2020/03/02/building-commandbox-custom-commands/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 CommandBox modules. These serve a range of purposes - modules are used to interact with the server lifecycle,...Notes on Migrating from MS SQL Server to PostgreSQL2020-02-04T00:00:00Z2020-02-04T00:00:00Zhttps://blog.mattclemente.com/2020/02/04/mssql-to-postgresql-migration-notes/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 and resources that will hopefully be helpful. A Note on VersionsMoving the DatabaseUpdating...Sizing Your Redis Cache for Sessions - A Quick Lesson Learned2020-01-21T00:00:00Z2020-01-21T00:00:00Zhttps://blog.mattclemente.com/2020/01/21/lucee-redis-session-cache-settings/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 end up with errors that are difficult to debug. I imagine the general principle discussed here applies...Contributing to CommandBox - Steps for Building and Developing Locally2019-12-12T00:00:00Z2019-12-12T00:00:00Zhttps://blog.mattclemente.com/2019/12/12/contributing-to-commandbox/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 might be helpful to share the steps for contributing. What follows is a brief guide to running your own...Using Redis with Lucee: An Approach with the CommandBox Docker Image and Ortus Redis Extension2019-11-14T00:00:00Z2019-11-14T00:00:00Zhttps://blog.mattclemente.com/2019/11/14/lucee-redis-ortus-extension/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 change and includes an example repo of the Lucee/Redis configuration discussed - which is to say, it...TIL: Generating .xlsx Files with CFML - An Easy Way to Reduce File Size2019-10-11T00:00:00Z2019-10-11T00:00:00Zhttps://blog.mattclemente.com/2019/10/11/til-generating-xlsx-files-with-coldfusion/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 generating spreadsheet files with ColdFusion, my options were limited to XLS or CSV. I would generate the...Adobe ColdFusion Summit 20192019-10-08T00:00:00Z2019-10-08T00:00:00Zhttps://blog.mattclemente.com/2019/10/08/adobe-coldfusion-summit-2019/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 disconcerting speed. As in years past, preparing for the talks took up more time than anticipated...What is the Modulus Operator? A Short Guide with Practical Use Cases2019-07-12T00:00:00Z2019-07-12T00:00:00Zhttps://blog.mattclemente.com/2019/07/12/modulus-operator-modulo-operation/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 its own right. The modulus operator, written in most programming languages as % or mod, performs...TIL: Compound Assignment Operators in CFML (+= and more)2019-06-14T00:00:00Z2019-06-14T00:00:00Zhttps://blog.mattclemente.com/2019/06/14/compound-assignment-operators-in-cfml/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 used += before, it just recently came to my attention that this syntax extends to other mathematical...How to Install and Manage Multiple Versions of Java (hint: jabba and jEnv)2019-05-31T00:00:00Z2019-05-31T00:00:00Zhttps://blog.mattclemente.com/2019/05/31/managing-multiple-java-jdk-versions/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 I had a way to use different versions of the JDK on my machine. This was due, at least in part, to...Into The Box 2019 (w/slides and code)2019-05-05T00:00:00Z2019-05-05T00:00:00Zhttps://blog.mattclemente.com/2019/05/05/into-the-box-2019/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 developer, this conference is worth making an effort to attend. Into the Box is, in turns, practical,...Script to Create Docker Swarm on DigitalOcean2019-03-28T00:00:00Z2019-03-28T00:00:00Zhttps://blog.mattclemente.com/2019/03/28/docker-swarm-initialization-script-digitalocean/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 some basic configuration options (Droplet size, number of masters/workers, etc) and automates the...Scripting Docker Host Creation on DigitalOcean without Docker Machine2019-03-04T00:00:00Z2019-03-04T00:00:00Zhttps://blog.mattclemente.com/2019/03/04/script-docker-host-creation-digitalocean-doctl/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 which I documented using Docker Machine to script host creation. The process I outlined there still...FusionReactor for Docker Swarm (Part 2, Alerting)2019-01-04T00:00:00Z2019-01-04T00:00:00Zhttps://blog.mattclemente.com/2019/01/04/configuring-fusionreactor-cloud-alerts/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 Alerting. While my use case is Docker Swarm, much of this is equally applicable to non-containerized...Updated Configuration for FusionReactor Cloud on Docker Swarm2018-12-14T00:00:00Z2018-12-14T00:00:00Zhttps://blog.mattclemente.com/2018/12/14/update-to-fusionreactor-cloud-configuration-on-swarm/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 to Swarm, one of our FusionReactor server groups (3 containers) disappeared from the Cloud...FusionReactor for Docker Swarm (Part 1, Installation)2018-11-21T00:00:00Z2018-11-21T00:00:00Zhttps://blog.mattclemente.com/2018/11/21/installing-fusionreactor-for-docker-swarm/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 not using it, you probably should be).[1] Moving to Swarm means that you can't continue to use the...How Not To Use Spreadsheet Functions in Lucee2018-11-05T00:00:00Z2018-11-05T00:00:00Zhttps://blog.mattclemente.com/2018/11/05/using-excel-spreadsheet-functions-with-lucee-5-on-docker/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 number of spreadsheet functions. There are a range of reasons you might want these in Lucee, from...TIL: The Other Way to Embed Images in Markdown2018-10-22T00:00:00Z2018-10-22T00:00:00Zhttps://blog.mattclemente.com/2018/10/22/til-reference-images-in-markdown/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: ![Alt Text](https://blog.mattclemente.com/public/500.png) And while this works, the syntax can be a bit clunky - I don't find it easy to scan when...Adobe ColdFusion Summit 20182018-10-03T00:00:00Z2018-10-03T00:00:00Zhttps://blog.mattclemente.com/2018/10/03/adobe-coldfusion-summit-2018/I was very fortunate to attend my second Adobe ColdFusion Summit this year. Prep for speaking at the conference is one of the reasons I haven't been able to blog recently - I presented an updated version of a previous talk: send.Better() - Giving Email a REST (slides here). This won't be a full conference review; just a few quick thoughts. As I wrote last year, Adobe runs an excellent conference....Install Lucee Extensions on CommandBox Docker Containers2018-08-17T00:00:00Z2018-08-17T00:00:00Zhttps://blog.mattclemente.com/2018/08/17/install-lucee-extensions-on-commandbox-docker-containers/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 Backstory: Using Memcached At work, we had a CMFL app that we needed to containerize. Our goal was to...Using PDFBox with ColdFusion2018-08-06T00:00:00Z2018-08-06T00:00:00Zhttps://blog.mattclemente.com/2018/08/06/java-pdfbox-with-cfml/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 text to be extracted from thousands of PDFs, some of which were quite large. Within Adobe ColdFusion,...Scripting Docker Host Creation on DigitalOcean2018-07-15T00:00:00Z2018-07-15T00:00:00Zhttps://blog.mattclemente.com/2018/07/15/create-docker-nodes-on-digitalocean-with-shell-script/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 Creation on DigitalOcean without Docker Machine. Instead of using Docker Machine, it uses DigitalOcean's...It's containers all the way down2018-06-27T00:00:00Z2018-06-27T00:00:00Zhttps://blog.mattclemente.com/2018/06/27/containers-all-the-way-down/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 not as easy as it could be, and 2) it's not as hard as some make it out to be. Don't expect to learn...Building My First ColdBox Modules2018-05-23T00:00:00Z2018-05-23T00:00:00Zhttps://blog.mattclemente.com/2018/05/23/from-forgebox-package-to-coldbox-module/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 the framework, so this was a helpful and straightfoward first step toward better understanding it....Into The Box 20182018-04-26T00:00:00Z2018-04-26T00:00:00Zhttps://blog.mattclemente.com/2018/04/26/into-the-box-2018/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 features, and I left the conference incredibly impressed at the work they're doing. While I use CommandBox...Publishing My First Package to ForgeBox2018-02-20T00:00:00Z2018-02-20T00:00:00Zhttps://blog.mattclemente.com/2018/02/20/publishing-my-first-package-to-forgebox/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 to ForgeBox. For posterity (or just my own reference), here's the process. Let's define what we're...Invoke Lambda from ColdFusion2018-01-18T00:00:00Z2018-01-18T00:00:00Zhttps://blog.mattclemente.com/2018/01/18/invoke-lambda-from-coldfusion/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 intrigued when he explained that ColdFusion could interact directly with AWS, via the Java SDK. The...Parsing AWS ARNs with CFML2018-01-11T00:00:00Z2018-01-11T00:00:00Zhttps://blog.mattclemente.com/2018/01/11/parsing-aws-arn-with-cfml/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 parse an ARN? Because they contain a lot of information - including the AWS service, region, account,...Adobe ColdFusion Summit 20172017-11-17T00:00:00Z2017-11-17T00:00:00Zhttps://blog.mattclemente.com/2017/11/17/cfsummit-2017/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 impressed by the size. I heard that attendance was slightly down, due to the horrific shooting a...TIL: cfmail debug=true2017-10-20T00:00:00Z2017-10-20T00:00:00Zhttps://blog.mattclemente.com/2017/10/20/til-cfmail-debug-true/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 to, yes, debug email issues. Adobe's documentation for cfmail has a fairly straightforward...Versioning With Git Tags2017-10-13T00:00:00Z2017-10-13T00:00:00Zhttps://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/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-friendly road-map for interacting with the codebase. When I decided to familiarize myself with...NCDevCon 20172017-10-09T00:00:00Z2017-10-09T00:00:00Zhttps://blog.mattclemente.com/2017/10/09/ncdevcon-2017/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 be giving a more CFML-centric version of the session. If you're interested in the CFML API wrappers...Using the Builder Pattern in ColdFusion - Concrete Examples from SendGrid.cfc2017-08-20T00:00:00Z2017-08-20T00:00:00Zhttps://blog.mattclemente.com/2017/08/20/using-the-builder-pattern-in-coldfusion/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 in ColdFusion before. So, if you're new to this design pattern (like I was), or you just want to see...A Complete Beginner Runs Adobe ColdFusion on Docker (Mac)2017-07-27T00:00:00Z2017-07-27T00:00:00Zhttps://blog.mattclemente.com/2017/07/27/adobe-coldfusion-on-docker-via-commandbox/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 official Adobe ColdFusion Docker image. I've heard, at various conferences and events, that Adobe...A Complete Beginner Runs Lucee on Docker (Mac)2017-07-26T00:00:00Z2017-07-26T00:00:00Zhttps://blog.mattclemente.com/2017/07/26/getting-started-with-coldfusion-for-docker/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 post picks up where the initial Docker walkthrough left off, and continues to document the steps I...A Complete Beginner Gets Started Using Docker (Mac)2017-07-25T00:00:00Z2017-07-25T00:00:00Zhttps://blog.mattclemente.com/2017/07/25/getting-started-with-docker/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 zero-to-Docker. Everyone says to get started at docker.io, but that site redirects now. If you're a...Updated Considerations When Validating Email with Mailgun2017-07-08T00:00:00Z2017-07-08T00:00:00Zhttps://blog.mattclemente.com/2017/07/08/new-considerations-validating-email-with-mailgun/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 changed? Should you still probably be validating your email with Mailgun? The answer, as usual, is that...Quick Tip - CFML Documentation on Mac2017-04-08T00:00:00Z2017-04-08T00:00:00Zhttps://blog.mattclemente.com/2017/04/08/quick-tip-cfml-documentation-with-alfred/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 fast access to both Adobe's ColdFusion documentation and cfdocs.org. Adobe Documentation Adobe's...What's that function - val()?2017-02-24T00:00:00Z2017-02-24T00:00:00Zhttps://blog.mattclemente.com/2017/02/24/whats-that-function-val/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 runnable examples, check out cfdocs.org/val. So, why was I trying to remember it; that is, what good...Why Does Git Keep Asking for My SSH Password (Bitbucket / Github)?2016-12-22T00:00:00Z2016-12-22T00:00:00Zhttps://blog.mattclemente.com/2016/12/22/-setting-ssh-password-when-git-forgets/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 is one of those "documentation" posts; hopefully others find it helpful as well. I recently updated...Switching from LastPass to 1Password and Keeping Your Folders2016-12-04T00:00:00Z2016-12-04T00:00:00Zhttps://blog.mattclemente.com/2016/12/04/switching-from-lastpass-to-1password/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 tags. This is more for my own reference than anything else. The process wasn't terribly smooth, but...You Should Probably Be Validating Email with Mailgun2016-09-01T00:00:00Z2016-09-01T00:00:00Zhttps://blog.mattclemente.com/2016/09/01/validating-email-with-mailgun-coldfusion/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 CFML developers, that easy method is supposed to be ColdFusion's isValid() function, but it has some...Live Reload with Jeykll and Hawkins2016-07-29T00:00:00Z2016-07-29T00:00:00Zhttps://blog.mattclemente.com/2016/07/29/live-reload-with-jekyll-and-hawkins/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 note that the approach used here is no longer needed. With the release of Jekyll 3.7 in January of...CFScript Syntax Highlighting with Rouge!2016-07-09T00:00:00Z2016-07-09T00:00:00Zhttps://blog.mattclemente.com/2016/07/09/cfscript-syntax-highlighting-with-rouge/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 been a fairly long process. I waited on posting, because the github-pages gem hadn't updated its...Working on a CFScript Rouge Lexer2016-06-09T00:00:00Z2016-06-09T00:00:00Zhttps://blog.mattclemente.com/2016/06/09/working-on-a-cfscript-rouge-lexer/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 had anticipated. CFML certainly has its quirks, and I even stumbled across a few operators that I was...TIL: callStackGet()2016-05-27T00:00:00Z2016-05-27T00:00:00Zhttps://blog.mattclemente.com/2016/05/27/til-callstackget/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(), which was apparently introduced in ColdFusion 10, but I had never encountered before. The backstory, in...Using AntiSamy with ColdFusion 112016-05-12T00:00:00Z2016-05-12T00:00:00Zhttps://blog.mattclemente.com/2016/05/12/antisamy-javaloader-getsafehtml/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 functions. These were added in ColdFusion 11, but I had not heard of them. While we ultimately didn't...Working With Rouge for the First Time2016-04-29T00:00:00Z2016-04-29T00:00:00Zhttps://blog.mattclemente.com/2016/04/29/working-with-rouge-for-the-first-time/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, so that I can start tinkering with it. I wasn't sure exactly where to begin, but I did anyway,...CFML API Wrappers2016-04-11T00:00:00Z2016-04-11T00:00:00Zhttps://blog.mattclemente.com/2016/04/11/building-cfml-api-wrappers/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), the exercise of writing the wrappers got me to think about APIs, my code, and open source code in a...Getting Started with CFLint2016-04-06T00:00:00Z2016-04-06T00:00:00Zhttps://blog.mattclemente.com/2016/04/06/getting-started-with-cflint/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 worked out a system for making them easy to integrate in my day-to-day development. I had seen the CFLint...Using ColdFusion Loops with Bootstrap Rows and Columns2016-03-30T00:00:00Z2016-03-30T00:00:00Zhttps://blog.mattclemente.com/2016/03/30/using-coldfusion-loops-and-bootstrap-rows/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 sure you close all the tags that you open, in the correct order. I've handled this in a variety of...A Note on IIS and Upgrading to ColdFusion 112016-03-23T00:00:00Z2016-03-23T00:00:00Zhttps://blog.mattclemente.com/2016/03/23/a-note-on-iis-and-upgrading-to-coldfusion-11/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 only ran into one complication - an IIS configuration issue - that had a simple solution, and also...Think MVC: On Validating in Services2016-03-16T00:00:00Z2016-03-16T00:00:00Zhttps://blog.mattclemente.com/2016/03/16/thinking-mvc-with-coldfusion-no-need-to-validate-data-in-service/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 my code. This is a small instance of my gradual shift from a procedural to MVC mindset. The reduction...Rouge Syntax Highlighting Issue2016-03-06T00:00:00Z2016-03-06T00:00:00Zhttps://blog.mattclemente.com/2016/03/06/rouge-syntax-highlighting-issue/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 until you've reached it the long way around, especially early in the process of learning something...Using QueryExecute (ColdFusion 11)2016-03-04T00:00:00Z2016-03-04T00:00:00Zhttps://blog.mattclemente.com/2016/03/04/using-queryexecute-on-coldfusion-11/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 from cfscript. I couldn't find too much out there on how to use it, so I did a little digging as we...On Wrapping (cf)http Calls in CFThread2016-03-01T00:00:00Z2016-03-01T00:00:00Zhttps://blog.mattclemente.com/2016/03/01/how-to-wrap-http-calls-with-cfthread/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 SES, we had been sending emails via SMTP with <cfmail> and it went off without a hitch[1]. When...Blogging with Jekyll (Part 3, Actually Using Github Pages)2016-02-24T02:59:43Z2016-02-24T02:59:43Zhttps://blog.mattclemente.com/2016/02/24/getting-started-with-jekyll-part-3/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. From Github Help: Setting up your Pages site locally with Jekyll. They recommend using the Github Pages...Blogging with Jekyll (Part 2, Jekyll Setup)2016-02-24T00:00:00Z2016-02-24T00:00:00Zhttps://blog.mattclemente.com/2016/02/24/getting-started-with-jekyll-part-2/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 have been.[1] The blog had already been set up (via Tinypress.co) to publish on Github Pages, so it...Blogging with Jekyll (Part 1, Wrestling with Ruby)2016-02-23T00:00:00Z2016-02-23T00:00:00Zhttps://blog.mattclemente.com/2016/02/23/getting-started-with-jekyll-part-1/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 blogging with Github Pages myself. What follows isn't a guide; it's just my log of the 600+ mistakes...Gotta start somewhere2016-02-17T00:00:00Z2016-02-17T00:00:00Zhttps://blog.mattclemente.com/2016/02/17/testing-out-tinypress/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.