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
# Execute docker run with --rm --network shared | |
# The shared network will be created if it dosn't already exist | |
dr () { | |
docker network inspect shared > /dev/null 2>&1 | |
if [ $? -ne 0 ] | |
then | |
docker network create shared > /dev/null 2>&1 | |
fi | |
local DOCKER_CMD="docker run --rm --network shared $@" | |
echo |
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 here: | |
# https://github.com/creationix/nvm#zsh | |
# place this after nvm initialization! | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then |
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 depPairs = [ | |
// "KittenService: ", | |
// "Leetmeme: Cyberportal", | |
// "Cyberportal: Ice", | |
// "CamelCaser: KittenService", | |
// "Fraudstream: Leetmeme", | |
// "Ice: " | |
// ]; | |
// | |
// Turn that into: `'KittenService, Ice, Cyberportal, Leetmeme, CamelCaser, Fraudstream'` |
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 storedTemplate = (a,b,c) => `a:${a}, b:${b}, c:${c}` | |
storedTemplate(1,2,3) |
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 fs = require( 'fs' ); | |
var b = require( 'browserify' )(); | |
var outputFile = fs.createWriteStream( './output.js' ); | |
b.add( './index.js' ); | |
b.require( './test.js', {expose: 't'} ); | |
b.bundle().pipe( outputFile ); |
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 gulp = require('gulp'); | |
var lib = require('./lib'); | |
var protractor = require("gulp-protractor").protractor; | |
var jarPath = lib.getProtractorSeleniumJarPath(); | |
gulp.task('default', function(){ | |
gulp.src(["./spec/*.js"]) | |
.pipe(protractor({ | |
configFile: "protractor.config.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 http = require('http'); | |
function RequestQueue() { | |
this._maxRequests = 3; | |
this._pendingCount = 0; | |
this._queue = []; | |
this.count = 0; | |
this._uriInQueue = {}; | |
} |
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
#-- Start pm-ops-utils dev --# | |
# Remove local modules and npm cache | |
alias npmPurge=" | |
rm -rf node_modules | |
npm cache clean | |
" | |
# Ugly, but it is a fail-safe way of generating npm-shrinkwrap.json | |
alias updateShrinkwrap=" |
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
""" Additional collections to augment Python's collections module. | |
""" | |
from collections import namedtuple | |
def defaultnamedtuple( | |
typename, | |
field_names, | |
verbose=False, | |
rename=False, |
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
""" Interview question | |
Write a method that takes a string, and returns the string in reverse. | |
For instance, if passed abc123 it should return 321cba | |
""" | |
class StringUtil(object): | |
""" Utility for strings |
NewerOlder