Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.

Recent Blog Posts by Ben Nadel

Using Derived Tables To Generate "Stats" For An Outer Query JOIN In MySQL 5.6.49

Most of the time, when writing SQL queries, I try to keep my queries as simple as possible . I find that this aids in both readability and performance. However, sometimes, the more complicated query is the best option . This is particularly true when writing reporting queries . And, one techniqu... read more »

Code Kata: Creating A Fluent, Closure-Based "Builder" API In Lucee CFML

As of late, I've been feeling very creatively blocked . Right now, work is taking every ounce of mental energy that I have, which is leaving me with little left over with which to create magic. As such, I just wanted to do something - anything - to create a little neural activity to keep the old... read more »

Accessing Cookies With The Same Name In Lucee CFML

This morning, I took a look at the fact that the first cookie wins in both JavaScript and ColdFusion when multiple cookies are assigned with the same name . As a quick follow-up post, I wanted to see if I could access all of the conflicting / colliding cookies in the HTTP Header data even if t... read more »

The First Cookie Wins When Conflicting Cookie Names Are Used With Different Settings In Lucee CFML

A few weeks ago at InVision , we did one of the most dangerous things you can do in a production application: we messed with some Cookie settings . And, unfortunately, we got a little burned when the change produced some unexpected behaviors - unexpected in so much as we didn't have the best ment... read more »

Deleting Temporary Upload Files In Our K8 Operational Readiness Probe In Lucee CFML

Over the weekend, I talked about the fact that some of our Lucee CFML containers at InVision were running out of disk space. It seems that the current release of Lucee will generate a duplicate temporary .upload file per CFThread ; and, that it won't delete these files automatically after th... read more »

The Elvis / Null Coalescing Operator Can Sometimes Replace The Safe Navigation Operator In Lucee CFML

Yesterday, when I was listening to the latest episode of the Modernize or Die Podcast , Brad Wood said something that I had not heard before: that the Safe Navigation operator can usually be replaced with the Elvis / Null Coalescing operator in Lucee CFML. I had always just assumed that ... read more »

Temporary Upload Files Are Duplicated And Persisted When A Request Uses CFThread In Lucee CFML

Earlier this week, Pablo Fredrikson from our Platform team was paged because one of the Kubernetes pods that runs one of our Lucee CFML containers was running out of disk space. Upon further investigation, he found that the server's temporary file directory was using over 160 Gigabytes of stora... read more »

Using Both STORE And DEFLATE Compression Methods With The zip CLI In Lucee CFML

A couple of months ago, I looked as using the zip CLI with the STORE or DEFLATE compression methods in Lucee CFML . The DEFLATE compression method attempts to shrink file sizes as it adds the files to an archive where as the STORE method just adds the files to the archive, but doesn't at... read more »

Proxying Amazon AWS S3 Pre-Signed-URL Uploads Using Netlify Functions

A couple of months ago, I looked at proxying Amazon S3 pre-signed URL uploads using Lucee CFML . This was a topic of interest because InVision has enterprise customers that block all direct access to Amazon AWS (for security purposes); and, the only way we can upload files to S3 is by &... read more »

Animation Timing-Functions Can Be Changed Per-Keyframe In CSS

Yesterday, I demonstrated that the animation-timing-function property is applied per-keyframe in CSS . Today, as a fast-follow, I wanted to demonstrate that the animation-timing-function can also be changed per-keyframe as well. In fact, this was the hot-tip that Una Kravets mentioned on t... read more »

Animation Timing-Functions Get Applied Per-Keyframe In CSS

A couple of weeks ago, I looked at creating a simple slide-show using dynamic keyframe animations in Angular 10.0.9 . In the video for that demo, I mentioned that my approach was somewhat limited because the timing-function wasn't granular enough. As it turns out, my assumption of granularity wa... read more »

Generating An Interactive Craft Sketch File From An InVision Prototype In Lucee CFML

At InVision , one of the tools that we offer is Craft / Craft-Manager , which provides a suite of functionality for generating interactive prototypes in Sketch and Photoshop. In recent years, the Sketch open file-format has evolved into a ZIP archive consisting of images and JSON (JavaScript ... read more »

Most ColdFusion Examples Of EncodeForCSS() Are Broken

I absolutely love the encodeForXYZ() functions in ColdFusion and Lucee CFML. They make life absolutely wonderful for developers ; and, more importantly, they make life safe for users because they prevent hosted and reflected XSS (Cross-Site Scripting) attacks. But, the one encoding function th... read more »

Wrestling With My Dogmatic Fear Of The REQUEST Scope And Accessing Global Variables In ColdFusion

For years, I've had a general notion that "global variables" are a "Bad Thing" ™. And, I've come to love Inversion of Control (IoC); and, I believe that Dependency Injection (DI) is one of the greatest things since sliced-bread. But, I fear that I've become blind to the pragmat... read more »

CSS Flexbox, Overflow, Text-Overflow Ellipses, And A Separation Of Concerns

As I've gotten older (and hopefully wiser), I've grown to love the separation of concerns between layout and content . And while this separation of concerns incurs more verbosity, it leads to cleaner, easier-to-maintain HTML and CSS. That said, the separation of concerns is not always perfectl... read more »

Using Inline-Block To Provide Consistent Padding And Element Width Inside An Overflow Container In CSS

This is primarily a note to self ; and, is something that has been covered several times on StackOverflow; but, I can never seem to remember the answer and end-up re-learning it each time. As such, I wanted to write it down! This post looks at how to get CSS padding and widths to work consiste... read more »

Using Constants To Help Clarify Boolean Arguments And Return Values In ColdFusion And JavaScript

A few weeks ago, I talked about how I often see some very questionable Boolean arguments in old, legacy code . This has kept Boolean arguments top-of-mind for me; and one thing that I've started to experiment with recently is the use of "Constants" - named, static values - to bring addit... read more »

Using NPM Run-Scripts To Execute Shell Commands In Lucee CFML

Over the last few months, I've looked at various ways that ColdFusion can interact with the command-line. For example, we can use a proxy script to run CFExecute from a working directory ; or, we can use Java's ProcessBuilder to interact with the underlying processes directly . The other day,... read more »

Creating A Simple Slide-Show With Dynamic Keyframe Animations In Angular 10.0.9

The other day at InVision , I came across a View within our AngularJS 1.2.22 SPA (Single-Page Application) that was using a 1,000-line jQuery plug-in to power the most basic of horizontal carousels. Upon further investigation, this was the only UI (User Interface) that was using this jQuery plug-i... read more »

Generating Rich Server-Side Reports In Lucee CFML

When it comes to rendering "Views" and / or "API Responses" in a ColdFusion application, I feel like I have a good-enough handle on where things are supposed to live within the application architecture (somewhat dictated by whatever framework I'm using). But, when it comes to g... read more »

Encapsulating Deep Object-Graph Traversal Using A Visitor Function In Lucee CFML

The other day, in JavaScript, I wrote some code that required three nested for -loops in order to locate data for consumption. The JavaScript code looked something like this: screens.forEach( ( screen ) => { screen.conversations.forEach( ( conversation ) => { read more »

Mapping Arrays-To-Structs And Structs-To-Arrays Using Mapping Functions In Lucee CFML

When mapping one data-set onto another data-set in ColdFusion, we can usually use the built-in .map() functions. This works great when the input and the output data-sets are the same type . But, every now and then, I want to map an Array onto a Struct ; or, a Struct onto an Array ; which i... read more »

isNumeric() And numberFormat() Can Work With Very Large Numbers In Lucee CFML

For historical reasons, I'm a bit weary of any kind of numeric value that won't fit into a Signed Integer in ColdFusion. I can't point to specific issues necessarily; but, I know that I've run into errors working with large numbers. That said, yesterday when I was looking at how to implement an in... read more »

Performing An In-Place Natural Sort On An Alpha-Numeric Array In Lucee CFML

In the past, I've looked at implementing a "Natural Sort order" in both JavaScipt and ColdFusion . However, my ColdFusion-based approach has always created a new array as part of its algorithm. Most of the time this doesn't matter; however, yesterday at InVision , I ran into a situa... read more »

Using A Closure To "Terminate" CFThread Tags Across Page Requests In Lucee CFML

While the CFThread tag has a "terminate" action; and Lucee has a threadTerminate() built-in function (BIF); these two approaches only work within a single page-request - any attempt to terminate a CFThread reference spawned from another page will result in a ColdFusion error. Over... read more »

RequestTimeout Setting Affects CFThread Execution In Lucee CFML

Yesterday, when I was exploring task threads in Lucee CFML , I noticed that my long-running CFThread tags were suddenly dying at around 30-seconds of execution time. And, after I poked around in the Lucee Administrator, I noticed that the default request timeout for the server was set to 30-... read more »

Using A Task CFThread To Run And Restart Daemon CFThreads Indefinitely In Lucee CFML

The CFThread tag has been one of the most awesome feature-additions to the ColdFusion language, allowing us to seamlessly and effortlessly run asynchronous code in parallel to the main page request. But, the CFThread has always been a kind of "one off" type of processing. And, for yea... read more »

Using Apache POI 3.17 To Save InVision Prototypes As Interactive PowerPoints In Lucee CFML

At InVision , I spend a lot of time lurking in our #Support Slack channel, watching all of the questions that get tossed around in hopes that I see something that sparks a moment of inspiration. And, just the other day, I saw one of our Customer Success associates mention that they had a client ... read more »

Using Negative Box-Shadow Spread To Communicate Depth In CSS

Earlier this week, in Episode 17 of the CSS Podcast: Shadows , Adam Argyle made the observation that in the "real world", when you pick an object up off a surface the shadow that forms beneath the object actually shrinks. He then noted that we can better emulate this behavior by using ... read more »

Thinking About Boolean Arguments As A Code-Smell In A Legacy Codebase

To say that Boolean arguments represent some sort of a "code-smell" is not something new or unique. Martin Fowler has a "FlagArgument" article on the topic dating way back to 2011. However, I've been working in a single legacy codebase since about the same time; and I've seen ... read more »