This will work with the config package.
View apitest.js
This file contains 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 apitest = module.exports = {}; | |
/** | |
* Have a Cooldown period between tests. | |
* | |
* @param {number} seconds cooldown in seconds. | |
* @return {Function} use is beforeEach(). | |
*/ | |
apitest.cooldown = function(seconds) { | |
return function(done) { |
View test.js
This file contains 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
test('test case', function(done) { | |
promise.method(function(result) { | |
assert.equal(result.name, 'mocha'); | |
}).then(done, done); | |
}); |
View list-mantri.js
This file contains 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 mantri = require('mantri'); | |
var mantriCompile = require('mantri/lib/mantri-build-compile'); | |
mantriCompile.getDepsFiles({ | |
jsRoot: './js', | |
src: './js/app.js', | |
gmockDir: mantri.helpers.getPath('closure-mock'), | |
}, function(status, results) { | |
console.log('Status should be true:', status); |
View README.md
Exporting sensitive data to Heroku's Environment
This script is ment to work with the node-config package, it will export whatever configuration data you set on the herokuOverride
Object, as a JSON serialized string, onto the NODE_CONFIG
environment variable on Heroku.
This results in the config package to use those values instead, thus enabling you to keep sensitive data out of your tracked files.
Usage
- Add
env.js
to your.gitignore
file - Edit it as per your needs
View index.js
This file contains 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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
View hack-lusca.js
This file contains 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
/** | |
* @fileOverview A CSRF Implementation for WebSocket calls. | |
*/ | |
var Promise = require('bluebird'); | |
var config = require('config'); | |
var lusca = require('lusca'); | |
var Middleware = require('./middleware'); |
View jquery-debounce.js
This file contains 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
// http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/ | |
// | |
// debouncing function from John Hann | |
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; |
View MySublimeCheatsheat.md
My Sublime cheatsheet
Packages to install
View string2path
This file contains 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
/* | |
* grunt | |
* http://gruntjs.com/ | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
* http://benalman.com/about/license/ | |
*/ | |
(function(exports) { |
OlderNewer