Skip to content

Instantly share code, notes, and snippets.

View gpickin's full-sized avatar

Gavin Pickin gpickin

View GitHub Profile

To be able to program in ColdFusion, a ColdFusion server needs to be installed. There are a couple of options available, but the one that we are going to focus on is a local development server.

A local development server is free and allows you to develop ColdFusion applications that use all of ColdFusion’s available features. There are, however, a few limitations, such as not being able to use the server as an external web server. That being said, there are additional benefits to using a local ColdFusion development server, such as not needing to have IIS or Apache installed, but instead using the packaged web server.

To install ColdFusion, follow the steps below:

@gpickin
gpickin / gist:7123120
Created October 23, 2013 17:36
Testing the whacko yyy dateformat mask. Coldfusion treats it as yy, railo treats it as yyyy, neither is what you expect, but CF 6 - 10 say its not a real mask, but neither of them error.
<cfoutput>#DateFormat(now(), "mm/dd/yyy")#</cfoutput>
@gpickin
gpickin / Index.cfm
Created December 28, 2013 01:29
Testing the "new" operator versus Traditional Component Creation
<h1>Tag - CreateObject .init()</h1>
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# Tag - CreateObject .init() Before">
<cfset obj = createObject("component", "inittest.main").init() />
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# Tag - CreateObject .init() After">
<h1>Tag - cfobject .init()</h1>
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# Tag - cfobject .init() Before">
<cfobject component="inittest.main" name="obj" />
<cfset obj = obj.init() />
@gpickin
gpickin / main.cfc
Last active January 1, 2016 13:59
CFC for testing "new" operator vs traditional cfc component object creation
<cfcomponent initmethod="init">
<!--- init is the default or implied method --->
<!--- having an incorrect initmethod name will cause the cfc to error --->
<cffunction name="init">
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# - Init">
</cffunction>
<cfscript>
blah = stuff({key1='foo',key2='bar'});
public boolean function stuff(struct mystruct)
{
return structIsEmpty(arguments.mystruct);
}
/*
The above will throw an error (eventually, again, it's not always reproduceable. You'll just get a random CF
<cfsetting requesttimeout="600">
<cfparam name="thelogname" default="clean_maillogH.log">
<cfinclude template="stopwatch.cfm">
<cfset ds = "dev_bktools">
<cfset stopwatch = makeStopwatch()>
<cfoutput>
<cfset stopwatch.start("Begin timing")>
if ( len(arguments.email) lte 5) {
// email too short
return 0;
}
else if ( len(arguments.password) eq 0 ) {
// empty password
return 0;
}
else {
var userDAO = uDAO;
if ( len(arguments.email) gt 5) {
if ( len(arguments.password) eq 0 ) {
var userDAO = uDAO;
var user = userDAO.getUserByLogin( arguments.email, arguments.password );
if ( user.recordcount gt 0)
if ( user.deletedat gt "") {
//login successful
return user.id;
}
else {
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 1
Created January 22, 2015 16:33
Getting Started with WebSQL in your Mobile App - Code 1
var dbSize = 5 * 1024 * 1024; // 5mb initial database
var db = openDatabase(“GavinsDB", "", “Gavins DB", dbSize,
function() {
console.log('db successfully opened or created');
},
function() {
console.log('db error');
}
);
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 2
Created January 22, 2015 16:38
Getting Started with WebSQL in your Mobile App - Code 2
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE doctors (id unique, doctorName)');
});