Instantly share code, notes, and snippets.

View trycf-gist-1542125903145-cfe420ca-8166-2acf-c218-b3c53a1afe51.cfm
<cfscript>
img=imageRead("https://console.staging-us.com/olmsDATA/ACCOUNT/133/TEMP/asdfa131331113081958.jpg");
//imageScaleToFit(img,281,"","highestQuality");
imageCrop(img,11, 0, 270, 217.61);
cfimage(action="writeToBrowser", source=img);
</cfscript>
<cfset FullNumber = 3.5432267>
<!--- round to 2 decimal places --->
<cfset RoundedNumber = FullNumber * 100>
View trycf-gist-1542137998512-f61faf9d-a5bd-9233-332d-0611797d384e.cfm
<cfscript>
// Just a new line.
x="
";
// This shows only chr(10) for both Lucee and ACF
writeoutput( "pre-serialize char: ") ;
for ( j=1;j<=len(x);j++) {
writeoutput( x.right(j).asc() & " " ) ;
}
View trycf-gist-1542139626016-620905c7-79c5-2162-fa17-f755f203501c.cfm
<cffunction name="convertQueryStringToStruct" returntype="struct">
<cfargument name="querystring" required="true" default="">
<cfscript>
var myStruct = structNew();
var vstr = 0;
var i = 0;
var vkey = 0;
var vval = 0;
View trycf-gist-1542124118894-f9e4005e-662e-f428-0792-7ebc3e0d506c.cfm
<cfscript>
var response = {
mpegDASH: 'http://127.0.0.1:80/foo/bar?baz=hoge',
appleHLS: 'http://127.0.0.1:80/foo/bar?baz=hoge',
adobeRTMP: 'rtmp://127.0.0.1:80/foo/bar?baz=hoge',
adobeHDS: 'http://127.0.0.1:80/foo/bar?baz=hoge',
rtsp: 'rtsp://127.0.0.1:80/foo/bar?baz=hoge',
test1: 'http://127.0.0.1/foo/bar?baz=hoge',
test2: ':http://127.0.0.1/foo/bar?baz=hoge',
};
View trycf-gist-1542124063176-48ee59ee-7594-6016-57f5-f7d805f79034.cfm
<cfscript>
var test = "sebastian.mueller@nbsp.de,
walter.seethaler@nbsp.de,katrin.bartonizek@nbsp.de,andreas.linnert@nbsp.de";
dump(test.toarray());
</cfscript>
View trycf-gist-1542124063176-48ee59ee-7594-6016-57f5-f7d805f79034.cfm
<cfscript>
var test = "sebastian.mueller@nbsp.de,
walter.seethaler@nbsp.de,katrin.bartonizek@nbsp.de,andreas.linnert@nbsp.de"
</cfscript>
View trycf-gist-1542119208539-e2278540-dd22-62dd-c4a6-13f428771298.cfm
<cfset typereport = "Vouchers&www|ee&ggg|pp&xyz|cc|2&Ad Hoc Comms">
<cfset reportArray = typereport.Split("&")>
<cfset docType = []>
<cfset compensation = []>
<cfset pages = []>
<cfloop array="#reportArray#" index="idx">
<cfif #ListLen(idx,"|")# EQ '3'>
<cfif ListGetAt(idx,3,"|") lte 3>
<cfset ArrayAppend(pages,ListGetAt(idx,3,"|"),"true")>
View trycf-gist-1542112858038-872d400a-0c04-065f-6320-6f7a587c7262.cfm
<cfset typereport = "Vouchers&www|ee&ggg|pp&xyz|cc|2&Ad Hoc Comms">
<cfset reportArray = typereport.Split("&")>
<cfset docType = []>
<cfset compensation = []>
<cfset pages = []>
<cfloop array="#reportArray#" index="idx">
<cfif #ListLen(idx,"|")# EQ '3'>
<cfif ListGetAt(idx,3,"|") lte 3>
<cfset ArrayAppend(pages,ListGetAt(idx,3,"|"),"true")>
View trycf-gist-1542111900801-c364f2a0-138a-0169-0b27-2747be63fcdc.cfm
<cfscript>
public numeric function calCheckDigit( string number ) {
var arrTable = [0,9,4,6,8,2,7,1,3,5];
var carry = 0;
var i = 1;
for ( i = 1; i <= len( number ); i++ ) {
// writeOutput((carry + mid( number, i, 1 ) ));
carry = arrTable[ (( carry + mid( number, i, 1 ) ) % 10 ) + 1 ];
}