Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Nadel bennadel

View GitHub Profile
@bennadel
bennadel / MyTag.cfm
Created Feb 25, 2021
ColdFusion Custom Tag Performance Differences Between CFModule And CFImport In Lucee CFML 5.3.7.47
View MyTag.cfm
<cfswitch expression="#thistag.executionMode#">
<cfcase value="start">
[
</cfcase>
<cfcase value="end">
]
</cfcase>
</cfswitch>
@bennadel
bennadel / FooterLinks.cfm
Created Feb 23, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part XI
View FooterLinks.cfm
@bennadel
bennadel / example11.cfm
Created Feb 23, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part X
View example11.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="./core/" />
<cfimport prefix="html" taglib="./core/html/" />
<!--- // ------------------------------------------------------------------------- // --->
<!--- // ------------------------------------------------------------------------- // --->
<core:Email
subject="HTML Entites"
teaser="When you have unicode you don't need images!">
@bennadel
bennadel / snippet-1.cfm
Created Feb 21, 2021
Replacing Blank Lines Using Multiline Mode RegEx Patterns In POSIX And Java In Lucee CFML 5.3.7.47
View snippet-1.cfm
<cfsavecontent variable="patternText"
>(?mx)
^
<!---
By wrapping the "blank line" in a repeating capture group, we use the
repeating nature of the pattern to replace adjacent lines rather than leaning
entirely on the "all" behavior of the reReplace() function.
--->
(
[\x20\x09]*
@bennadel
bennadel / test.cfm
Created Feb 20, 2021
Finding All Unique Paths In A Tree Structure In Lucee CFML 5.3.7.47
View test.cfm
<cfscript>
// Setup our Tree for demonstration purposes. Each node in this tree is named based
// on its depth and its order at a particular depth.
tree = xmlParse("
<a1>
<b1>
<c1>
<d1 />
<d2 />
@bennadel
bennadel / code-sample.txt
Created Feb 19, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part IX
View code-sample.txt
<h1>
Hello world
</h1>
<p>
This is an inlined code sample file.
</p>
<p>
This is a really long line that will have to have some sort of wrapping in order to not break the layout. And, the following line is a really long line that has no whitespace.
@bennadel
bennadel / Comment.cfm
Created Feb 16, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part VIII
View Comment.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="../core/" />
<cfimport prefix="html" taglib="../core/html/" />
<cfimport prefix="ex9" taglib="./" />
<!--- Define custom tag attributes. --->
<cfparam name="attributes.commentCreatedAt" type="date" />
<cfparam name="attributes.commentText" type="string" />
<cfparam name="attributes.margins" type="string" default="none xlarge" />
<cfparam name="attributes.userAvatarUrl" type="string" default="" />
@bennadel
bennadel / Avatar.cfm
Created Feb 15, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part VII
View Avatar.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="../core/" />
<cfimport prefix="html" taglib="../core/html/" />
<!--- Define custom tag attributes. --->
<cfparam name="attributes.fontSize" type="numeric" default="14" />
<cfparam name="attributes.imageUrl" type="string" default="" />
<cfparam name="attributes.initials" type="string" default="" />
<cfparam name="attributes.margins" type="string" default="none normal" />
<cfparam name="attributes.size" type="numeric" default="36" />
@bennadel
bennadel / ImageGrid.cfm
Created Feb 14, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part VI
View ImageGrid.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="../core/" />
<cfimport prefix="html" taglib="../core/html/" />
<!--- // ------------------------------------------------------------------------- // --->
<!--- // ------------------------------------------------------------------------- // --->
<cfswitch expression="#thistag.executionMode#">
<cfcase value="start">
<cfoutput>
@bennadel
bennadel / Body.cfm
Created Feb 13, 2021
Using ColdFusion Custom Tags To Create An HTML Email DSL In Lucee CFML 5.3.7.47, Part V
View Body.cfm
<!--- Import custom tag libraries. --->
<cfimport prefix="core" taglib="../core/" />
<cfimport prefix="html" taglib="../core/html/" />
<!--- // ------------------------------------------------------------------------- // --->
<!--- // ------------------------------------------------------------------------- // --->
<cfswitch expression="#thistag.executionMode#">
<cfcase value="start">
<cfoutput>