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 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 / 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: {
@gpickin
gpickin / 00_environment_setup.js
Last active May 31, 2018 06:28
This Cordova Hook determines which Environment your app is building for, and replaces an Environment Javascript Object to allow the App to behave accordingly.
#!/usr/bin/env node
var environmentList = ['debug','staging','prod'];
var fs = require("fs");
var path = require("path");
console.log('-----------------------------');
console.log("Running hook: "+path.basename(process.env.CORDOVA_HOOK));
@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 / 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 / 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 / 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)