Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-1.11.2.min.js"></script>
</head>
<body>
<!--- 1 ************************************************************************ --->
<cfset DateToday = now() />
<cfdump var = "#DateToday#" />
<script type="text/javascript">
var d = new Date();
console.log( d )
</script>
<!--- 2 ************************************************************************ --->
@cflove
cflove / UPS.Tracking.cfm
Created February 10, 2015 19:28
Track UPS packages with ColdFusion. Simple skeleton.
<cfsavecontent variable= "x">
<?xml version="1.0"?>
<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber></AccessLicenseNumber>
<UserId></UserId>
<Password></Password>
</AccessRequest>
<?xml version="1.0"?>
<TrackRequest>
<TrackingNumber>1ZA478X20198248503</TrackingNumber>
@cflove
cflove / css-cfm-test.cfm
Created February 7, 2015 19:59
Class-Test
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type="text/css">
.result {font-family:Verdana; border-radius:10px; color:white; padding:10px}
.looser {background-color:black;}
.winner {background-color:red;}
</style>
<cfheader name="content-disposition" value="attachment; filename=test.txt"/>
<cfheader name="X-Sendfile" value="D:\iis\hello.txt"/>
<cfcontent type="text/plain">
select EmailAddress from [Person].[EmailAddress]
where [BusinessEntityID] =
(
SELECT [BusinessEntityID]
FROM [Person].[Person]
where FirstName = 'Ken'
and LastName = 'Kwok'
)
----------------------------------------
select EmailAddress from [Person].[EmailAddress]
@cflove
cflove / Railo-PDF.cfc
Created November 21, 2014 15:34
Fetch list of columns and their values for Railo CFM. Not complete, just enough functionality for my current use.
<cfcomponent displayname = "PDFTools" output= "Yes" accessors="true" >
<cfproperty name="file">
<cfproperty name="map">
<cffunction name = "init" access = "Public" output = "No" returntype = "Any">
<cfargument name = "filePath" required= "Yes" type = "String" default = "" />
<cfset local.p = createObject("java",'org.apache.pdfbox.pdmodel.PDDocument') />
<cfset COSName = createObject("java",'org.apache.pdfbox.cos.COSName') />
<cfset setFile( local.p.load( arguments.filePath ) )/>
@cflove
cflove / test.cfm
Last active August 29, 2015 14:08
Railo Cookie Test
<cfif not structKeyExists(cookie,'Bingo')>
<cfcookie secure="false" httpOnly="true" name="Bingo" value="" />
Cookie Created with an empty value. Refresh the Browser to confirm.
<cfelse>
Cookie Exists. All good.
</cfif>
@cflove
cflove / ssl
Created October 30, 2014 17:51
covert pfx from cft and key
openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt
create table #DailyIncome(VendorId nvarchar(10), IncomeDay nvarchar(10), IncomeAmount int)
insert into #DailyIncome values ('SPIKE', 'FRI', 100)
insert into #DailyIncome values ('SPIKE', 'MON', 300)
insert into #DailyIncome values ('FREDS', 'SUN', 400)
insert into #DailyIncome values ('SPIKE', 'WED', 500)
insert into #DailyIncome values ('SPIKE', 'TUE', 200)
insert into #DailyIncome values ('JOHNS', 'WED', 900)
insert into #DailyIncome values ('SPIKE', 'FRI', 100)
insert into #DailyIncome values ('JOHNS', 'MON', 300)
insert into #DailyIncome values ('SPIKE', 'SUN', 400)