View .zshrc
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 |
View .zshrc
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 |
View CodeChallenge.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 depPairs = [ | |
// "KittenService: ", | |
// "Leetmeme: Cyberportal", | |
// "Cyberportal: Ice", | |
// "CamelCaser: KittenService", | |
// "Fraudstream: Leetmeme", | |
// "Ice: " | |
// ]; | |
// | |
// Turn that into: `'KittenService, Ice, Cyberportal, Leetmeme, CamelCaser, Fraudstream'` |
View storedTemplate.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
const storedTemplate = (a,b,c) => `a:${a}, b:${b}, c:${c}` | |
storedTemplate(1,2,3) |
View run.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 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 ); |
View gulpfile.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 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", |
View gist:9680084
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 = {}; | |
} |
View gist:9558866
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=" |
View collection.py
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, |
View interview.py
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