Skip to content

Instantly share code, notes, and snippets.

cflove / gist:2d73ae2834d1aa9944b221032dcb673b
Created April 16, 2023 13:57
create a favicon.icon file with coldfusion
View gist:2d73ae2834d1aa9944b221032dcb673b
<cffunction name="createFavicon" access="public" returntype="void">
<cfargument name="letter" type="string" required="true">
<cfargument name="saveLocation" type="string" required="true">
<!--- Set image dimensions (16x16 pixels) --->
<cfset width = 16>
<cfset height = 16>
<!--- Create a buffered image with transparency --->
<cfset BufferedImage = createObject("java", "java.awt.image.BufferedImage")>
View List of self closing ColdFusion Tags
cflove / winSCP.cfm
Last active September 24, 2020 02:15
ColdFusion custom tag to work with WinSCP / sftp. This use external files and write hostkey and script file in the same dir location of the custom tag template. Change default attributes. This need WinSCP installed in the server.
View winSCP.cfm
<cf_WinSCP action ="listdir"
username =""
password =""
host =""
name ="qryDirectory"
directory ="" />
<cf_WinSCP action="exists"
username =""
View coldfusion cert
keytool -import -storepass [password] -noprompt -alias -keystore C:\ColdFusion8\runtime\jre\lib\security\cacerts -trustcacerts -file C:\ColdFusion8\runtime\jre\lib\security\xxx.cer
View gist:b4c6921021530985d9a2
<cffunction name="testCidrRange" output="false" returntype="boolean">
<cfargument name="CIDR" required="true" type="string">
<cfargument name="TestIP" required="true" type="string">
<cfset var CIDRParts = ListToArray(arguments.CIDR, "/")>
<cfset var CIDRAddress = ListToArray(CIDRParts[1], ".")>
<cfset var CIDRMask = CIDRParts[2]>
<cfset var TestIPAddress = ListToArray(arguments.TestIP, ".")>
<cfset var CIDRRealAddress = 0>
<cfset var CIDRRealMask = 0>
View gist:c7dc42b546c62e3c6110
keytool -import -storepass changeit -noprompt -keystore C:\ColdFusion8\runtime\jre\lib\security\cacerts -trustcacerts -alias isecurus -file C:\inetpub\isecurus.cer
View gist:c30f3d4ab46aa4362062
<!doctype html>
<meta charset="utf-8">
<title>Untitled Document</title>
.error {color:red}
<script src=""></script>
cflove / spreadsheet.cfm
Created March 11, 2015 03:37
Custom Tag to Read Excel file with Railo and return a query. This read character data and formula, not binary objects.
View spreadsheet.cfm
<cfparam name="attributes.src" default="0">
<cfparam name="attributes.query" default="q">
<cfswitch expression="#thisTag.ExecutionMode#">
<cfcase value="start">
<cfset inputStream = CreateObject("java", "").init(JavaCast("string", attributes.src )) />
<cfset XSSFWorkbook = CreateObject("java", "org.apache.poi.xssf.usermodel.XSSFWorkbook").init(inputStream) />
<cfset DataFormatter = CreateObject("java", "") />
<cfset Evaluator = CreateObject("java", "org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator").init(XSSFWorkbook) />
View jquery.html
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<script src="js/jquery-1.11.2.min.js"></script>
View js-cfm.cfm
<!--- 1 ************************************************************************ --->
<cfset DateToday = now() />
<cfdump var = "#DateToday#" />
<script type="text/javascript">
var d = new Date();
console.log( d )
<!--- 2 ************************************************************************ --->