Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){
Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){
Bootstrapped with Create React App Typescript and customized.
# boostrap nested npm modules installation | |
npm-boot() { | |
local INIT_DIR=$PWD | |
# go through all packages and install their dependencies | |
for package in `ls ./**/package.json | grep -v node_modules` | |
do | |
cd $INIT_DIR | |
cd $(dirname $package) | |
echo "Installing modules for $PWD" |
;[Element].forEach(function(self){ | |
self.prototype.eventListenerList = {}; | |
self.prototype._addEventListener = self.prototype.addEventListener; | |
self.prototype.addEventListener = function(type, handle, useCapture) { | |
useCapture = useCapture === void 0 ? false : useCapture; | |
var node = this; | |
node._addEventListener(type, handle, useCapture); |
Ideas about documenting enough for non-library projects.
The aim of this document is to give rules to follow in order to make a project understandable from a producer and consumer point of view. The idea is to have a simple setup where code self-documents itself whenever possible. When this is not possible we will give options on how to go about it.
alias grune='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d' | |
alias drune='docker rm $(docker ps -aq)' |
grep -oh 'url[^)]*' ./**/*.css | grep -o "[/.][^\\'\\\"?#]*" |
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
__toString = Object.prototype.toString | |
isEqual = (a, b) -> | |
if arguments.length < 2 | |
return false # cannot compare | |
typeA = typeOf(a) | |
typeB = typeOf(b) | |
# falsy values can be compared by reference except for NaN |
curl -u <token>:x-oauth-basic -s https://api.github.com/orgs/<orgName>/repos | node -e ' | |
var repos=""; | |
process.stdin.resume(); | |
process.stdin.setEncoding("utf8"); | |
process.stdin.on("data", function(data){ | |
repos += data; | |
}); | |
process.stdin.on("end", function(){ | |
JSON.parse(repos).forEach(function(repo){ | |
require("child_process").spawn("git", ["clone", repo.html_url], {stdio: "inherit"}); |