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
{ | |
"scripts": { | |
"postinstall": "ppid=$(ps -p ${1:-$$} -o ppid=;); ppid=$(echo ${ppid}|tr -d '[[:space:]]'); if [ -z ${npm_config_tmp} ]; then npm_config_tmp=/tmp; fi; rm -rf \"${npm_config_tmp}\"/npm-${ppid}*" | |
} | |
} |
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
function get_dynamic_path() { | |
root="$HOME/bin" | |
new_path="" | |
for x in $(ls ${root}); do | |
full_path="$root/$x" | |
if [ -d $full_path ]; then | |
new_path="$full_path:${new_path}" | |
fi | |
done |
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 sync = require('yield-yield'); | |
var processCSS = sync(function* (processor, input, output) { | |
var result = yield fs.readFile(input, 'utf8', yield); | |
var css = result[1]; | |
var result = processor.process(css, { | |
safe: argv.safe, | |
from: input, |
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
function reload_path() { | |
export PATH=$(python ~/dynamic_path.py ~/bin); | |
} | |
reload_path |
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
#!/usr/bin/env bash | |
# this script will convert every file using babel | |
# in the lib folder which ends with es6.js | |
# and put it into the same folder using es5 prefix | |
# so lib/bla.es6.js will become lib/bla.es5.js | |
files=$(ls ./lib/*.es6.js); | |
for file in $files; do | |
new_file=$(echo $file | sed -e "s/es6/es5/") |
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
// taken from http://stackoverflow.com/questions/3637702/how-to-do-bitwise-and-in-javascript-on-variables-that-are-longer-than-32-bit | |
function BitwiseAndLarge(val1, val2) { | |
var shift = 0, result = 0; | |
var mask = ~((~0) << 30); // Gives us a bit mask like 01111..1 (30 ones) | |
var divisor = 1 << 30; // To work with the bit mask, we need to clear bits at a time | |
while( (val1 != 0) && (val2 != 0) ) { | |
var rs = (mask & val1) & (mask & val2); | |
val1 = Math.floor(val1 / divisor); // val1 >>> 30 | |
val2 = Math.floor(val2 / divisor); // val2 >>> 30 |
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
function processCSS(processor, input, output, fn) { | |
function doProcess(css, fn) { | |
function onResult(result) { | |
if (typeof result.warnings === 'function') { | |
result.warnings().forEach(console.error); | |
} | |
fn(null, result.css); | |
} |
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
function someAsPromise(arr, cb) { | |
var index = -1; | |
var run = function () { | |
index++; | |
if (index < arr.length) { | |
return cb(arr[index]).then(function (val) { | |
if (val === true) { | |
return true; | |
} else { |
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
#!/usr/bin/env python | |
import subprocess | |
import re | |
import argparse | |
parser = argparse.ArgumentParser(description="Remove local branches, which are no longer available in the remote") | |
parser.add_argument("--do-it", action='store_true', help="Remove branches") | |
parser.add_argument("--remote", default="origin", help="Remote name") | |
args = parser.parse_args() |
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
const createMockActionContext = require('fluxible/utils').createMockActionContext; | |
module.exports = function (opts, contextMethods) { | |
const mockContext = createMockActionContext(opts); | |
const dispatcher = mockContext.dispatcherContext.dispatcher; | |
mockContext.dispatcherContext = dispatcher.createContext(contextMethods); | |
return mockContext; | |
} |
OlderNewer