Skip to content

Instantly share code, notes, and snippets.

<cfscript>
rp = "https://www.kahootz.com///lkfjkd//djdjd";
if (find("://", rp)) {
parts = listToArray(rp, "://");
writedump(parts);
remparts = replacenocase(rp, "#parts[1]#://", "");
writedump(remparts);
rp = parts[1] & "://" & reReplace(parts[2], "/{2,}", "/", "all");
} else {
<cfscript>
echo("hello world");
</cfscript>
<cfscript>
jsonBody = "NTSFI_2025FAA90649";
jsonBody = replaceNoCase(jsonBody, "NTSFI_2025FAA90649", "TST_" & randRange(10000000, 99999999));
</cfscript>
<cfscript>
function foo() {
return 0;
}
x = foo() ?: 0;
writeDump( x )
function bar() {
return;
<cfset file ="http:\localhost:8020\index.cfm?event=user.displayVolunteerProfilePhoto&profilePhotoFilePath=1865\Volunteer\449422\temp\close%2Epng">
<cfset filename = listlast(file, "/")>
<cfdump var="#filename#">
<cfset filename = decodehtml(filename)>
<cfdump var="#filename#">
<cfset file ="http:\localhost:8020\index.cfm?event=user.displayVolunteerProfilePhoto&profilePhotoFilePath=1865\Volunteer\449422\temp\close%2Epng">
<cfset filename = listlast(file, "\")>
<cfdump var="filename">
<cfset ui_groupInfo = {"gid"=3298}>
<cfoutput>
#listFindNoCase("3074,3298", ui_groupInfo.gid)# eq true
</cfoutput>
<cfscript>
lstMonths = 'jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dev';
str = "31JUL2025";
dump(reReplace(str, "[^0-9]", "", "all"));
</cfscript>
<html>
<head></head>
<body>
<!-- Structures -->
<cfset book = StructNew()>
<cfset book.title = "Title1">
<cfset book.author = "Author1">
<cfset book.price = 100>
<cfoutput>#book.title#, #book.author#, #book.price#<br></cfoutput>
<html>
<head>
</head>
<body>
<!-- Structures -->
<cfset book = StructNew()>
<cfset book.title = "Title1">
<cfset book.author = "Author1">
<cfset book.price = 100>