Skip to content

Instantly share code, notes, and snippets.

<cfscript>
writedump( timeformat( now(), "mm/dd/yyyy CAPRICCIO CARIBOU" ) )
</cfscript>
<cfscript>
writedump( datetimeformat( now(), "mm/dd/yyyy CAPRICCIO CARIBOU" ) )
</cfscript>
<cfset testString = 'win how'> <cfset local.originalTempString = rereplacenocase(testString,"[^']\b(1|2|3|4|5|6|7|8|9|0|$|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|about|after|all|also|an|and|another|any|are|as|at|be|because|been|before|being|between|both|but|by|came|can|come|could|did|do|does|each|else|for|from|get|got|has|had|he|have|her|here|him|himself|his|how|if|in|into|is|it|its|just|like|make|many|me|might|more|most|much|must|my|never|no|now|of|on|only|or|other|our|out|over|re|said|same|see|should|since|so|some|still|such|take|than|that|the|their|them|then|there|these|they|this|those|through|to|too|under|up|use|very|want|was|way|we|well|were|what|when|where|which|while|who|will|with|would|you|your)[^']\b"," ","ALL")> <cfset local.newTempString = rereplacenocase(testString, "(^|[^'])\b(1|2|3|4|5|6|7|8|9|0|\$|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|about|after|all|also|an|and|another|any|are|as|at|be|because|been|before|being|between|both|but|by|came|can|come|could|did
<cfset local.originalTempString = rereplacenocase('how to win',"[^']\b(1|2|3|4|5|6|7|8|9|0|$|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|about|after|all|also|an|and|another|any|are|as|at|be|because|been|before|being|between|both|but|by|came|can|come|could|did|do|does|each|else|for|from|get|got|has|had|he|have|her|here|him|himself|his|how|if|in|into|is|it|its|just|like|make|many|me|might|more|most|much|must|my|never|no|now|of|on|only|or|other|our|out|over|re|said|same|see|should|since|so|some|still|such|take|than|that|the|their|them|then|there|these|they|this|those|through|to|too|under|up|use|very|want|was|way|we|well|were|what|when|where|which|while|who|will|with|would|you|your)[^']\b"," ","ALL")> <cfset local.newTempString = rereplacenocase('how to win', "(^|[^'])\b(1|2|3|4|5|6|7|8|9|0|\$|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|about|after|all|also|an|and|another|any|are|as|at|be|because|been|before|being|between|both|but|by|came|can|come|could|did|do|does|each|else|for|from|
<cfset students = [
{"Name" = "Alice", "Grades" = [85,90,78]},
{"Name" = "Bob", "Grades" = [92,88,95]},
{"Name" = "Charlie", "Grades" = [70,75,80]}
] />
<!--- This function will take the data in students and turn it into an organized object --->
<cffunction name="tagGetStudents">
<cfoutput>
<cfset students = "
Alice,85,90,78
Bob,92,88,95
Charlie,70,75,80
"; />
<cfoutput>
"#students#"
</cfoutput>
<cffunction name="hallo">
<cfset var st={}>
<cfset structInsert(st, 1, 10)>
<cfdump var="#st.1#">
</cffunction>
<cfscript>
<cfoutput>
<cfparam name="url.orderID" default="" />
<cfoutput>
<cfif url.orderID NEQ "">
<!--- ORDER DETAILS --->
<cfset orderDetails = $.slatwall.getEntity('order', '#url.orderID#')>
<cfif isNull(orderDetails) or (orderDetails.getAccount().getAccountID() neq $.slatwall.getAccount().getAccountID())>
<p class="noOrders">No orders found.</p>
<cfelse>
<cfscript>
public boolean function isStrictNumeric(any value) {
if (!isNumeric(arguments.value)) return false;
// 001 is not strict numeric -> serialize as string
if (arguments.value >= 1 && left(arguments.value, 1) == "0") return false;
// .111111 is not strict numeric -> serialize as string
if (left(arguments.value, 1) == ".") return false;
// +111111 is not strict numeric -> serialize as string
if (left(arguments.value, 1) == "+") return false;
<cfscript>
public boolean function isStrictNumeric(any value) {
if (!isNumeric(arguments.value)) return false;
// 001 is not strict numeric -> serialize as string
if (arguments.value >= 1 && left(arguments.value, 1) == "0") return false;
// .111111 is not strict numeric -> serialize as string
if (left(arguments.value, 1) == ".") return false;
// +111111 is not strict numeric -> serialize as string
if (left(arguments.value, 1) == "+") return false;