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
// {{compare unicorns ponies operator="<"}} | |
// I knew it, unicorns are just low-quality ponies! | |
// {{/compare}} | |
// | |
// (defaults to == if operator omitted) | |
// | |
// {{equal unicorns ponies }} | |
// That's amazing, unicorns are actually undercover ponies | |
// {{/equal}} | |
// (from http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/) |
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
/** | |
* yo-marionette-config.js | |
* | |
* The idea is to have a config file from which to read the folder structure of the | |
* application from that should be used when generating files through the generator | |
* instead of having it hardcoded in the generators. This file is also a good place | |
* to keep file generation options as well. | |
* | |
* Possible actions to create to go along with the yo-marionette-config.js: | |
* ---------------------------------------------------------------------------- |
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 fromArrayMap (arrayMap, convertAllArrays) { | |
convertAllArrays = convertAllArrays || true; | |
var map = new Map(), value; | |
arrayMap.forEach(function(x) { | |
value = Array.isArray(x[1]) ? fromArrayMap(x[1]) : x[1]; | |
map.set(x[0], value); | |
}); | |
return map; | |
} | |
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
/** | |
* Created by edelacruz on 2/17/14. | |
*/ | |
(function (context) { | |
/** | |
* Takes a namespace string and fetches that location out from | |
* an object/Map. If the namespace doesn't exists it is created then | |
* returned. | |
* Example: _namespace('hello.world.how.are.you.doing', obj) will | |
* create/fetch within `obj`: |
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
/** | |
* Created by edelacruz on 2/17/14. | |
* A shim for generating map objects for hash maps and array maps | |
* (arrays of 2 item arrays [0] 'key', [1] 'value') | |
*/ | |
define(['es6-shim', 'checkjs'], function (_namespace) { | |
function fromArray (arrayMap, recursive) { | |
recursive = recursive || false; | |
var map = new Map(), value; |
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 _process(value) { | |
return new Promise(function (fulfill, reject) { | |
var count = 0, timeout; | |
timeout = setInterval(function () { | |
console.log('iteration ' + count); | |
if (count > 5 && value !== 'fail') { fulfill(true); clearInterval(timeout); } | |
else if (count > 5 && value === 'fail') { reject('Operation timed out.'); clearInterval(timeout); } | |
count += 1; | |
}, 100); | |
}); |
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
/** | |
* Short script (**Note** needs to run with `--harmony` flag (testing on node 0.12.0)) | |
* for getting rid of the 'Windows.old' folder and also is a custom rmdirp of sorts: overcomes the memory limitations of the rmdirp module when running on windows (and maybe linux?). | |
* Just replace `pathToOperateOn` with the location of your 'Windows.old' folder. | |
* Run it and celebrate! :-D (thumbsup)! | |
* (Also excuse the big tabs/spaces. Had some issues with my pc, had no software installed and use notepad to write it lol!) | |
*/ | |
var fs = require('fs'), | |
path = require('path'), | |
pathToOperateOn = 'C:\Windows.old', |
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
/** | |
* Creates and appends a script tag to the `document` at `insertLocation`. (This snippet is a good candidate for adding an | |
* interval or a timeout on the returned $.deffered|HTMLScriptElement) | |
* @param options hash of the following parameters: | |
* @param src {String|HTMLScriptElement} - Script source or script element. Required. | |
* @param doc {document} - `document` object. Optional. Default `document`. | |
* @param insertLocation {String} - Location at which to insert the script tag [head,body]. Optional. Default 'body'. | |
* @param onError {Function} - On error callback. Optional. If `$.getScript` is available these callbacks gets passed to `.fail()`. | |
* @param onSuccess {Function} - On success/completion callback. Optional. | |
* @param useGetScript {Boolean} - Whether to use `$.getScript` if it is available. Optional. Default `false`. |
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
/** | |
Conversion of http://eslint.org/docs/rules/ to an actual .eslintrc file: | |
Copied: 04/01/2015 | |
Copied by: Ely De La Cruz <[email protected]> | |
*/ | |
/** | |
Rules: | |
Rules in ESLint are divided into several categories to help you better understand their value. Additionally, not all rules are enabled by default. Those that are not enabled by default are marked as being off. | |
**-------------------------------------------------------------------------------------------------------------------**/ |
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
# --------------------------------------------------------------------------------------------------------------------- # | |
# Conversion of http://eslint.org/docs/rules/ to an actual .eslintrc file: | |
# Copied: 04/01/2015 | |
# Updated to yaml format: 05/15/2015 | |
# Copied by: Ely De La Cruz <[email protected]> | |
# --------------------------------------------------------------------------------------------------------------------- # | |
# --------------------------------------------------------------------------------------------------------------------- # | |
# Environemnt Types: | |
# --------------------------------------------------------------------------------------------------------------------- # |
OlderNewer