Skip to content

Instantly share code, notes, and snippets.

<cfscript>
var test = 'Demo';
</cfscript>
<cffunction name="setNamesFromFullName" access="public" returntype="void" output="false" hint="I set the name properties from the name appearing on a card">
<cfargument name="name" type="string" required="true" />
<cfset local.nameArray = listToArray(arguments.name, " ",true) />
<cfif arrayLen(local.nameArray)>
<!--- set the title --->
<cfset local.firstNameArrayIndex = 1 />
<cfif listFindNoCase("mr,mrs,ms,miss,dr", local.nameArray[1])>
<cfdump var="#local.nameArray[1]#">
<cfscript>
testStr = "hello'' there' im not working''''"
testStr = testStr.reReplace("\'\'","~","all");
writedump(testStr);
</cfscript>
<cfscript>
test = "hello'' there' im not working''''"
test = test.reReplace("\'\'","~","all");
writedump(test);
</cfscript>
<cfscript>
function getIsMonthlyWaived( paymentDate ) {
if (
findNoCase( "Legacy", "Legacy" )
&&
(
!isDate( this.getPDF_Creation_Date() ) or
dateDiff(
"d",
<cfscript>
detailWarnings = {
"holidayBillRateDeviation": {
"warningType": "holidayBillRateDeviation",
"requiresApproval": "NO",
"warning": true,
"warningTypeID": 5,
"requiresResolution": "NO",
"description": "Holiday Bill Rate different from default.",
"persistTillResolve": "NO"
<cfset a = 4>
<cfset b = 25>
<cfif a = b OR b = b>
c = 10
<cfelse>
d=15
</cfif>
<cftransaction>
<cfquery datasource="foodb"> SELECT * FROM FOO</cfquery>
<cftransaction action="commit">
</cftransaction>
<cfset variables.str="Hello">
<cfoutput>
#variables.str#
</cfoutput >
<cfsilent>
<cfset variables.str="World">
<cfoutput>
#variables.str#
</cfoutput>
</cfsilent>
<cfset s = "(bingo)">
<pre>
<cfoutput>
//remove first char
#right(s, -1)#
#right(s, len(s)-1)#
#s.right(-1)#
//remove last char
#left(s, -1)#