Skip to content

Instantly share code, notes, and snippets.

View cfmitrah's full-sized avatar
🤓
Looking for new projects

Saravanamuthu Aka CF Mitrah cfmitrah

🤓
Looking for new projects
View GitHub Profile
@cfmitrah
cfmitrah / demoGateway.cfc
Created March 11, 2019 07:57
Demo Lucee Event Gateway - Gateway Component
<cfcomponent extends="Gateway">
<cfset fields=array(
field("Directory","directory","",true,"The directory you want to watch","text")
,field("Watch subdirectories","recurse","true",true,"Should we watch the directory and all subdirectories too","checkbox")
,field("Interval (ms)","interval","60000",true,"The interval between checks, in miliseconds","text")
,field("File filter","extensions","*",true,"The comma separated list of file filters to match (* = all files). Examples: *user*,*.gif,2010*,myfilename.txt","text")
,group("CFC Listener Function Definition","Definition for the CFC Listener Functions, when empty no listener is called",3)
,field("Change","changeFunction","onChange",true,"called when a file change","text")
@cfmitrah
cfmitrah / demoGatewayListener.cfc
Created March 11, 2019 08:01
Demo Lucee Event Gateway - Listener Component
<cfcomponent>
<cfset variables.logFileName = "demoLogGateway" />
<cffunction name="checkChange" access="public" output="no" returntype="void">
<cfargument name="data" type="struct" required="yes">
<cfset logDetails("change:#serialize(data)#", "information")>
</cffunction>
<cffunction name="logDetails" returntype="void" access="private" output="no">
<cfargument name="content" required="yes" type="string" />
@cfmitrah
cfmitrah / sassCompilerListener.cfc
Last active March 18, 2019 05:30
Lucee Event Gateway - Sass Compiler Listener Component
<cfcomponent>
<cffunction name="compileSASS" access="public" output="no" returntype="void">
<cfargument name="data" type="struct" required="yes">
<cftry>
<cfset fileCompile(
arguments.data.directory,
arguments.data.name,
replaceNoCase(arguments.data.name, "scss", "css", "ALL")
)>
<cfoutput>
<!--- Here I have mentioned the code for create the object for different types of barcodes --->
<!--- For CODABAR --->
<cfset BarcodeCodabar = createobject("java","com.lowagie.text.pdf.BarcodeCodabar")>
<!--- For CODE39 --->
<cfset Barcode39 = createobject("java","com.lowagie.text.pdf.Barcode39")>
<!--- For CODE128 --->
<cfset Barcode128 = createobject("java","com.lowagie.text.pdf.Barcode128")>
<!--- For EAN13 & EAN8 --->
<!--- Here I have mentioned the sample code for generate the barcode for CODE-128 type --->
<cfdocument format="pdf" orientation="portrait" pagetype="a4">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>BarCode Test</title>
</head>
<body>
<span style="font-family:CODE-128">AB123456ab789</span>
@cfmitrah
cfmitrah / create_list.cfm
Created October 21, 2019 07:39
reating the audience list
<cfscript>
// Create List
addList = application.mailChimpService.addList();
writeDump(addList);abort;
</cfscript>
<cfcomponent output="false">
<!--- Application settings --->
<cfset this.name = createUUID() />
<cfset this.sessionManagement = true>
<cfset this.sessionTimeout = createTimeSpan(0,0,30,0)>
<cfsetting showdebugoutput="yes">
<cfset this.mappings["/ModelGlue"] = getDirectoryFromPath(getCurrentTemplatePath()) & "ModelGlue/">
<cfset this.mappings["/ColdSpring"] = getDirectoryFromPath(getCurrentTemplatePath()) & "ColdSpring/">
<cfset this.mappings["/ApplicationName"] = getDirectoryFromPath(getCurrentTemplatePath())>
</cfcomponent>