Skip to content

Instantly share code, notes, and snippets.

View gpickin's full-sized avatar

Gavin Pickin gpickin

View GitHub Profile
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 5
Created January 22, 2015 16:43
Getting Started with WebSQL in your Mobile App - Code 5
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS doctors (id unique, doctorName)’);
tx.executeSql(‘INSERT INTO doctors (id, doctorName) values(?,?)’, [1,”9th Doctor”]);
});
@gpickin
gpickin / gist:18df16bf645104bc8871
Created January 31, 2015 07:33
openDatabase Promise
$.when( createDB() ).done( function( data ){
createTables();
loadBaseData();
}).fail( function( error ){
console.log(‘Error creating / connecting to DB’);
console.log( error );
});
@gpickin
gpickin / 01_uglify.js
Created March 18, 2015 22:16
Cordova Hook for /hooks/after_prepare/
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var UglifyJS = require('uglify-js');
var CleanCSS = require('clean-css');
var ngAnnotate = require('ng-annotate');
var cssMinifier = new CleanCSS({
noAdvanced: true, // disable advanced optimizations - selector & property merging, reduction, etc.
keepSpecialComments: 0 // remove all css comments ('*' to keep all, 1 to keep first comment only)
@gpickin
gpickin / gruntfile.js
Created April 15, 2015 06:19
gruntfile.js - Example of Jasmine with Grunt Watch
// Original Source: http://www.meanstack.co/setting-up-jasmine-and-grunt/
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('node_modules/grunt/package.json'),
jasmine: {
all: {
src: ['js/*.js' ],
options: {
//'vendor': ['path/to/vendor/libs/*.js'],
@gpickin
gpickin / 05_jasmine.js
Created May 9, 2015 14:35
This is a Cordova Hook that runs your Jasmine tests automatically. Best to run after 02_jshint.js in the before_prepare folder
#!/usr/bin/env node
var path = require('path');
var Command = require('../../node_modules/jasmine/lib/command.js');
var Jasmine = require('../../node_modules/jasmine/lib/jasmine.js');
var thePath = path.join( path.resolve(), 'www');
var jasmine = new Jasmine({ projectBaseDir: thePath });
var examplesDir = path.join(__dirname, '..', 'node_modules', 'jasmine-core', 'lib', 'jasmine-core', 'example', 'node_example');
var command = new Command(thePath);
@gpickin
gpickin / 01_cordovacleanup.js
Last active August 29, 2015 14:20
This Cordova Hook cleans up your Cordova www folder, removes those pesky OS files like Thumbs.db and .DS_Store.
#!/usr/bin/env node
// Original : https://blog.nraboy.com/2015/01/hooks-apache-cordova-mobile-applications/
// Modified by Gavin Pickin - 05/09/15
var fs = require('fs');
var path = require('path');
var foldersToProcess = [
"js",
@gpickin
gpickin / Gruntfile.js
Last active November 8, 2015 22:11
Gruntfile.js for Testbox Runner
// Original Source: http://www.meanstack.co/setting-up-jasmine-and-grunt/
// Combined with https://gist.github.com/seancoyne/9b1b24dca08ed9282fc6
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig({
pkg: grunt.file.readJSON('node_modules/grunt/package.json'),
jasmine: {

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() />