Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Nadel bennadel

View GitHub Profile
@bennadel
bennadel / test.cfm
Created Jun 17, 2021
Managing And Reporting Errors During Parallel Array Iteration In Lucee CFML 5.3.7.47
View test.cfm
<cfscript>
// Let's download these images in parallel.
imageUrls = [
"https://picsum.photos/500/300",
"https://picsum.photos/501/301",
"https://picsum.photos/502/302",
"https://picsum-BAD-DNS.photos/503/303", // This will fail (invalid domain name).
"https://picsum.photos/504/304",
"https://picsum.photos/505/305",
@bennadel
bennadel / child.cfm
Created Jun 16, 2021
Strange Variable-Name Error When Writing To Base Tag In Adobe ColdFusion 2018
View child.cfm
<cfscript>
parentTag = getBaseTagData( "cf_parent" );
variableName = "$$entity:h1:small-title";
parentTag[ variableName ] = true;
writeDump( parentTag );
</cfscript>
@bennadel
bennadel / example1.cfm
Created Jun 15, 2021
Adobe ColdFusion 2018 Compatible Version Of My ColdFusion Custom Tag DSL For HTML Emails
View example1.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="./core/" />
<cfimport prefix="html" taglib="./core/html/" />
<cfimport prefix="imageGrid" taglib="./customized/image-grid/" />
<cfimport prefix="customized" taglib="./customized/" />
<!--- // ------------------------------------------------------------------------- // --->
<!--- // ------------------------------------------------------------------------- // --->
<core:Email
@bennadel
bennadel / LaunchDarklyRestGateway.cfc
Created Jun 13, 2021
Using The LaunchDarkly REST API To Update Rule Configuration In Lucee CFML 5.3.7.47
View LaunchDarklyRestGateway.cfc
component
output = false
hint = "I provide low-level semantic abstractions over LaunchDarkly's HTTP REST API."
{
/**
* I initialize the LaunchDarkly REST API with the given access token.
*/
public void function init(
required string accessToken,
@bennadel
bennadel / app.component.ts
Last active Jun 12, 2021
Experimenting With Dynamic Template Rendering In Angular 2 RC 1
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// Import the application components and services.
import { DynamicRepeaterComponent } from "./dynamic-repeater.component";
@Component({
selector: "my-app",
directives: [ DynamicRepeaterComponent ],
@bennadel
bennadel / angularjs-modals.htm
Created Mar 23, 2015
Creating A Simple Modal System In AngularJS
View angularjs-modals.htm
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Creating A Simple Modal System In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@bennadel
bennadel / code-1.cfm
Created Mar 25, 2014
Using GMail's Plus-Style Addressing To Track Bounce Back Email Meta Data
View code-1.cfm
<!---
Define the customer ID. This is going to be made part of the
FailTo address for easier bounce-back tracking.
--->
<cfset customerID = "C12345" />
<!---
Send out a email to an email address we know won't exist. In
the FailTo address, since we are using a GMail account (hosted),
we can use PLUS (+) addressing. We are going to append the
@bennadel
bennadel / example-1.cfm
Created Jun 8, 2021
Managing Lists Of IDs Using HTML FORM Posts In Lucee CFML 5.3.7.47
View example-1.cfm
<cfoutput>
<form method="post" action="#cgi.script_name#">
<!---
These form fields will be submitted to the server as individual fields.
However, since they all have the SAME NAME, the ColdFusion server will
automatically collapse them down into a single, comma-delimited list.
--
NOTE: There is an Application.cfc setting to change the default behavior from
a LIST to an ARRAY (sameFormFieldsAsArray); but, I have not tried this.
@bennadel
bennadel / RandomValue.cfc
Created Jun 4, 2021
Changing Function Argument Defaults At Runtime In Lucee CFML 5.3.7.47
View RandomValue.cfc
component
output = false
hint = "I provide random integers between a given set of values."
{
/**
* I initialize the randomizer with the given min/max range.
*/
public void function init(
numeric minValue = 1,
@bennadel
bennadel / logs.txt
Created Jun 1, 2021
Migrating Password Hashing Algorithms In Lucee CFML 5.3.7.47
View logs.txt
[INFO] Could not verifying BCrypt hash, moving onto older hash.
[INFO] Older, insecure MD5 hash [d49a5b5dff1f7dfcc2fd3d0b85dcd0a3] verified for user.
[INFO] Storing hash [$2b$10$VxeTfuPjf3JjfTnw5GK75uhtS5jlP2m8O/.TFwZKpMseRy55dKnJ6] for user [ben@bennadel.com]