This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="MidLeft" returntype="string" output="no" hint="Returns numChars characters from the left side of startPos in the string"> | |
<cfargument name="stringVal" type="string" required="yes" default=""> | |
<cfargument name="startPos" type="numeric" required="yes" default="1"> | |
<cfargument name="numChars" type="numeric" required="yes" default="0"> | |
<!--- If startPos exceeds length of string argument then start picking characters from string end position ---> | |
<cfif arguments.startPos gt len(arguments.stringVal)> | |
<cfset arguments.startPos = len(arguments.stringVal)> | |
</cfif> | |
<cfset var fromPos = arguments.startPos - arguments.numChars + 1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="DateFormatPlus" returntype="string" output="yes" hint="Formats date with optional custom mask options. Each custom mask starts with $ sign and followed by a number in mask. For eg. $1 will be replaced by custom mask value given as 1st parameter after mask parameter and $2 will be replaced by 2nd parameter after mask."> | |
<cfargument name="dateVal" required="yes" type="date" default="#now()#"> | |
<cfargument name="mask" required="yes" type="string" default="yyyy-mm-dd"> | |
<!--- Apply default date mask ---> | |
<cfset var newDate = dateFormat(arguments.dateVal, arguments.mask)> | |
<!--- Apply custom date mask ---> | |
<cfloop from="1" to="#arrayLen(arguments)-2#" index="loopIndex"> | |
<cfset var maskPos = find("$#loopIndex#", newDate) - 1> | |
<cfswitch expression="#arguments[loopIndex+2]#"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="readCFCoreClass" output="false" hint="Get list of methods available in Coldfusion core class files (recursively)"> | |
<cfargument name="searchFolder" type="string" required="true" hint="Path of specific folder in which to be searched (with backslash at end)"> | |
<cfargument name="searchFile" type="string" required="true" hint="Path of specific class file to be searched (without .class extension)"> | |
<cfargument name="searchRecurse" type="boolean" required="false" default="false" hint="Search should be recursive or not?"> | |
<!--- Container for final results ---> | |
<cfset var searchResults = queryNew("Class,Method,Return_Type", "varchar,varchar,varchar")> | |
<!--- Path of folder into which jar file "<CF installation path>/WEB-INF/lib/cfusion.jar" is extracted ---> | |
<cfset var searchRootParentPath = ""> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |