Skip to content

Instantly share code, notes, and snippets.

View index.md
View console.cfm
<cfif thisTag.executionMode == "start">
<script>
console.log('Message to the browser console. My variable: <cfoutput>#attributes.variable#</cfoutput>');
</script>
</cfif>
@kukielp
kukielp / index.cfm
Created Jan 5, 2021
Customtage CFML
View index.cfm
Calling a custom tag.
<cfset someVariable = "First Name + Last Name" />
<cf_console variable="#someVariable#" />
View demo.cfm
<cfscript>
loopLength = 10
qry = queryNew("id,dstart_time", "integer,Timestamp");
for(i=1; i<loopLength; i++){
tmpDate = dateAdd("d",-i,now());
queryAddRow(qry);
querySetCell(qry, "id", i);
querySetCell(qry, "dstart_time", tmpDate);
}
View cf.sh
sudo yum install -y https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.rpm
wget https://services.gradle.org/distributions/gradle-6.5-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-6.5-bin.zip
# Set 2 EVN variables to add gradel to the path
export GRADLE_HOME=/opt/gradle/gradle-6.5
export PATH=${GRADLE_HOME}/bin:${PATH}
# Ensure the ENV variables persist in a new terminal session
View gist:53cf6fd67fc29693b9e5ceb17904b378
.PHONY: build clean deploy
build:
./cfusion/bin/lambdazip.sh
clean:
rm ./cfusion/bin/dist/cf-aws-serverless.zip
deploy: clean build
sam deploy
View gist:499f9ba816145f17eb4a294894eed4d0
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 900
Resources:
AWSServerless:
Type: AWS::Serverless::Function
View gist:78e1f87cfc139acd7c400484c7433089
<cfquery name="q" result="r">
select *
from customer
</cfquery>
<cfdump var="#q#"/>
<cfdump var="#r.EXECUTIONTIME#"/>
View gist:9616e1b420ca472d920cf9a6bcc98926
<cfquery name="q" result="r">
select *
from customer
</cfquery>
<cfdump var="#q#"/>
<cfdump var="#r.EXECUTIONTIME#"/>
View gist:42d854cc720133029c1a00362e36785b
component {
this.name="cfmlServerless";
this.applicationTimeout = CreateTimeSpan(10, 0, 0, 0); //10 days
this.sessionManagement=false;
this.clientManagement=false;
this.setClientCookies=false;
// Yes yes, shoudl not embed in code but for PoC it's fine.
this.datasources = {