Skip to content

Instantly share code, notes, and snippets.

View gpickin's full-sized avatar

Gavin Pickin gpickin

View GitHub Profile
@gpickin
gpickin / ModuleConfig.cfc
Created July 23, 2016 05:27
mysecrets ModuleConfig - Part 3 - adding and removing submenu items from the Modules Admin Menu
/**
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
*/
component hint="My Secrets Module Configuration"{
// Module Properties
this.title = "MySecrets";
@gpickin
gpickin / ModuleConfig.cfc
Created July 20, 2016 16:11
mySecrets ModuleConfig - Step 1
/**
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
*/
component hint="My Secrets Module Configuration"{
// Module Properties
this.title = "MySecrets";
@gpickin
gpickin / ModuleConfig.cfc
Created May 27, 2016 20:41
Module Config generated by Commandbox create module command
/**
Module Directives as public properties
this.title = "Title of the module";
this.author = "Author of the module";
this.webURL = "Web URL for docs purposes";
this.description = "Module description";
this.version = "Module Version";
this.viewParentLookup = (true) [boolean] (Optional) // If true, checks for views in the parent first, then it the module.If false, then modules first, then parent.
this.layoutParentLookup = (true) [boolean] (Optional) // If true, checks for layouts in the parent first, then it the module.If false, then modules first, then parent.
this.entryPoint = "" (Optional) // If set, this is the default event (ex:forgebox:manager.index) or default route (/forgebox) the framework
<cfoutput>
#html.doctype()#
<html lang="en">
<head>
<meta charset="utf-8">
<title>Custom Module Layout</title>
<meta name="description" content="ContentBox Application Template">
<meta name="author" content="Ortus Solutions, Corp">
<!---Base URL --->
<base href="#getSetting( "HTMLBaseURL" )#" />
/**
Module Directives as public properties
this.title = "Title of the module";
this.author = "Author of the module";
this.webURL = "Web URL for docs purposes";
this.description = "Module description";
this.version = "Module Version";
this.viewParentLookup = (true) [boolean] (Optional) // If true, checks for views in the parent first, then it the module.If false, then modules first, then parent.
this.layoutParentLookup = (true) [boolean] (Optional) // If true, checks for layouts in the parent first, then it the module.If false, then modules first, then parent.
this.entryPoint = "" (Optional) // If set, this is the default event (ex:forgebox:manager.index) or default route (/forgebox) the framework
@gpickin
gpickin / 02_jshint.js
Created March 18, 2015 22:14
Cordova Hook for /hooks/before_prepare/
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var jshint = require('jshint').JSHINT;
var async = require('async');
var foldersToProcess = [
'js', 'js/services'
];
<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
@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>
@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 / 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>