Skip to content

Instantly share code, notes, and snippets.

View icirellik's full-sized avatar
💾
Staying Retro

Cameron Rollheiser icirellik

💾
Staying Retro
View GitHub Profile
@icirellik
icirellik / remove-empty-directories.sh
Created December 11, 2015 14:04
Find and Remove Empty Directories
# Prints all the empty directories in the local dir.
find . -type d -empty -print
# Removes all the empty directories in the local dir.
find . -type d -empty -delete
# Lint all files in the directory recursivly
eslint --fix --ext .js --ext .jsx .
https://www.npmjs.com/package/v8-profiler
'use strict';
var profiler = require('v8-profiler');
profiler.startProfiling();
// ...
var cpuProfile = profiler.stopProfiling();
require('fs').writeFileSync(__dirname + '/foo.cpuprofile', JSON.stringify(cpuProfile));
@icirellik
icirellik / react-test-with-context.js
Last active August 25, 2015 20:20
React Test with Context
var TestUtils = React.addons.TestUtils;
var context = {};
var elementWithContenxt = React.withContext(context, function () {
return new Element({
prop1: 'property'
});
});
@icirellik
icirellik / test.js
Created August 25, 2015 20:02
Pass data between beforeEach, afterEach and it in mocha tests.
var expect = require('expect');
describe.only('Sample', function () {
beforeEach(function () {
this.currentTest.value = 'Winning!';
});
it('Uses current test data', function () {
expect(this.test.value).to.equal('Winning!');