Skip to content

Instantly share code, notes, and snippets.

View FredKSchott's full-sized avatar

Fred K. Schott FredKSchott

View GitHub Profile
@FredKSchott
FredKSchott / node-breakfast-two
Last active August 29, 2015 13:56
South Bay Node.js Enterprise Breakfast
What: Breakfast for south bay enterprise node.js leaders
When: 9 - 10:30am, Wednesday, February 19
Where:
Box
4440 El Camino Real
Los Altos, CA 94022
Why: To regularly meet to discuss enterprise node.js concerns and encourage increased community in the south bay.
@FredKSchott
FredKSchott / shelljs-lint-json.js
Last active August 29, 2015 14:05
ShellJS Recipes - JSON Linting - http://shelljs-recipes.tumblr.com/
// Dependencies: jsonlint
echo('Validating JSON');
exec('node ./node_modules/jsonlint/lib/cli.js -q -c ' + JSON_FILES);
@FredKSchott
FredKSchott / shelljs-lint-js.js
Last active August 29, 2015 14:05
ShellJS Recipes - JavaScript Linting - http://shelljs-recipes.tumblr.com/
// Dependencies: eslint (https://github.com/eslint/eslint)
echo('Validating JavaScript');
exec('node ./node_modules/eslint/bin/eslint ' + JS_FILES);
@FredKSchott
FredKSchott / shelljs-files-by-type.js
Last active August 29, 2015 14:05
Getting Files By Type - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// Useful for passing files & directories as command arguments
var JS_DIRS = ['lib', 'tests'].join(' ');
var JS_FILES = find(['lib', 'tests']).filter(fileType('js')).join(' ');
var JSON_FILES = find(['lib', 'tests']).filter(fileType('json')).join(' ');
@FredKSchott
FredKSchott / shelljs-istanbul-code-coverage.js
Created August 16, 2014 08:07
Getting Code Coverage with Istanbul - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// Dependencies: istanbul, mocha (can substitute with any testing library)
echo('Running Tests & Generating Code Coverage');
exec('node ./node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --recursive ' + TEST_DIR);
@FredKSchott
FredKSchott / shelljs-changelog-git.js
Created August 18, 2014 15:47
Generating a Changelog with Git - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// dependencies: a git repo, git tag release versioning
function generateChangeLog(lastRelease, nextRelease) {
echo('Generating Changelog from ' + lastRelease + ' to ' + nextRelease);
('## ' + nextRelease + '\n').to('CHANGELOG.tmp');
exec('git log ' + lastRelease + '...' + nextRelease + ' --pretty=format:"+ \`%h\` - %s" >> CHANGELOG.tmp');
cat("CHANGELOG.tmp", "CHANGELOG.md").to("CHANGELOG.new.md");
mv("CHANGELOG.md", "CHANGELOG.old.md");
mv("CHANGELOG.new.md", "CHANGELOG.md");
@FredKSchott
FredKSchott / shelljs-lint-package.json.js
Last active August 29, 2015 14:05
Validating `package.json` - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// Dependencies: package-json-validator (https://github.com/gorillamania/package.json-validator)
echo('Validating package.json');
exec('node ./node_modules/package-json-validator/bin/pjv package.json');
@FredKSchott
FredKSchott / shelljs-files-recently-changed.js
Created August 21, 2014 15:33
Getting Recently Changed Files - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// dependencies: a git repo
var CHANGED_FILES = exec('git diff --name-only master..HEAD').output.replace(/\n/g,' ');
@FredKSchott
FredKSchott / shelljs-mocha.js
Last active August 29, 2015 14:05
Running Tests with Mocha - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// Dependencies: mocha (http://visionmedia.github.io/mocha/)
echo('Running Tests');
exec('node ./node_modules/mocha/bin/_mocha --recursive' + TEST_DIR);
@FredKSchott
FredKSchott / shelljs-mocha-nyan.js
Last active August 29, 2015 14:05
Running Javascript Tests (with Nyan Cat) - ShellJS Recipes - http://shelljs-recipes.tumblr.com/
// Dependencies: mocha (http://visionmedia.github.io/mocha/)
echo('Running Tests');
exec('node ./node_modules/mocha/bin/_mocha -R nyan --recursive ' + TEST_DIR);
// 380 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_,------,
// 0 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_| /\_/\
// 0 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-^|__( ^ .^)
// _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- "" ""
//
// 380 passing (2s)