This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var connect = require('gulp-connect'); | |
| var cors = function (req, res, next) { | |
| res.setHeader('Access-Control-Allow-Origin', '*'); | |
| res.setHeader('Access-Control-Allow-Headers', '*'); | |
| next(); | |
| }; | |
| gulp.task('server:test', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define gulp before we start | |
| var gulp = require('gulp'); | |
| // Define Sass and the autoprefixer | |
| var sass = require('gulp-sass'); | |
| var prefix = require('gulp-autoprefixer'); | |
| // This is an object which defines paths for the styles. | |
| // Can add paths for javascript or images for example | |
| // The folder, files to look for and destination are all required for sass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (ng) { | |
| "use strict"; | |
| function MyController($scope) { | |
| // Use Controller As syntax | |
| // https://github.com/johnpapa/angular-styleguide#style-y032 | |
| var vm = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * ------------------ The Life-Cycle of a Composite Component ------------------ | |
| * | |
| * - constructor: Initialization of state. The instance is now retained. | |
| * - componentWillMount | |
| * - render | |
| * - [children's constructors] | |
| * - [children's componentWillMount and render] | |
| * - [children's componentDidMount] | |
| * - componentDidMount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function traverse(x, level) { | |
| if (isArray(x)) { | |
| traverseArray(x, level); | |
| } else if ((typeof x === 'object') && (x !== null)) { | |
| traverseObject(x, level); | |
| } else { | |
| console.log(level + x); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * @TODO figure out why web security isn't working | |
| */ | |
| open = function (url, options) { | |
| var uri = 'http://localhost:' + CONFIG.PORT + '/tms.html', | |
| tempDir = 'C:/temp-chrome-eng'; | |
| var args = [ | |
| '--user-data-dir=' + tempDir, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Prompt Task | |
| * WIP/ not integrated | |
| */ | |
| gulp.task('prompt', function () { | |
| return gulp.src('') | |
| .pipe( | |
| $.prompt.prompt( | |
| [{ | |
| type: 'input', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JSON.flatten = function(data) { | |
| var result = {}; | |
| function recurse (cur, prop) { | |
| if (Object(cur) !== cur) { | |
| result[prop] = cur; | |
| } else if (Array.isArray(cur)) { | |
| for(var i=0, l=cur.length; i<l; i++) | |
| recurse(cur[i], prop + "[" + i + "]"); | |
| if (l == 0) | |
| result[prop] = []; |