View CodeChallenge.js
// var depPairs = [
// "KittenService: ",
// "Leetmeme: Cyberportal",
// "Cyberportal: Ice",
// "CamelCaser: KittenService",
// "Fraudstream: Leetmeme",
// "Ice: "
// ];
//
// Turn that into: `'KittenService, Ice, Cyberportal, Leetmeme, CamelCaser, Fraudstream'`
View storedTemplate.js
const storedTemplate = (a,b,c) => `a:${a}, b:${b}, c:${c}`
storedTemplate(1,2,3)
View run.js
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
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
var http = require('http');
function RequestQueue() {
this._maxRequests = 3;
this._pendingCount = 0;
this._queue = [];
this.count = 0;
this._uriInQueue = {};
}
View gist:9558866
#-- 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
""" Additional collections to augment Python's collections module.
"""
from collections import namedtuple
def defaultnamedtuple(
typename,
field_names,
verbose=False,
rename=False,
View interview.py
""" 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
View while.js
var x = [1,2,3]
//back to front
while(x.length){
var value = x.pop();
console.log(value);
}
//array is now empty, lets replace it
var x = [1,2,3]
View managers.py
from django.db import models
class QuerySetManager(models.Manager):
"""Add new QuerySet methods using a Model inner class
Reference:
http://djangosnippets.org/snippets/734/
"""