Skip to content

Instantly share code, notes, and snippets.

View michaelBenin's full-sized avatar
🏠
Remote

Michael Benin michaelBenin

🏠
Remote
View GitHub Profile
// Usage:
// var express = require('express')
// require('enableMultipleViewRoots')(express)
module.exports = function(express) {
var old = express.view.lookup;
function lookup(view, options) {
// If root is an array of paths, let's try each path until we find the view
if (options.root instanceof Array) {
'use strict';
var expect = require('chai').expect;
describe('Page testing', function () {
it('Page title test.', function (done) {
browser
.url('http://127.0.0.1:8000')
//.setValue('#js-command-bar-field', 'grunt-webdriver')
@michaelBenin
michaelBenin / gist:9450872
Created March 9, 2014 17:06
Backbone-rest error
TypeError: Property 'handle' of object #<Object> is not a function
at next_layer (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/route.js:97:11)
at Route.dispatch (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/route.js:98:5)
at c (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/index.js:196:24)
at Function.proto.process_params (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/index.js:255:12)
at next (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/index.js:190:19)
at next_layer (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/route.js:77:14)
at next_layer (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/route.js:81:14)
at Route.dispatch (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/router/route.js:98:5)
at c (/Users/Adminstrator/Desktop/node-startup/node_modules/express/lib/rout
var webdriverjs = require('../index'),
client = webdriverjs.remote({
desiredCapabilities: {
browserName: 'chrome',
version: '27',
platform: 'XP',
tags: ['examples'],
name: 'This is an example test'
},
host: 'ondemand.saucelabs.com',
/*! d3.chart - v0.2.0
* License: MIT Expat
* Date: 2014-02-21
*/
module.exports = function(D3) {
"use strict";
/*jshint unused: false */
var d3 = D3;
var hasOwnProp = Object.hasOwnProperty;
@michaelBenin
michaelBenin / sort_requirements.py
Created July 20, 2014 21:48
Sort requirements pip files or requirements.txt for python dependencies
requirements_file = 'base.pip'
requirements = open(requirements_file, 'r')
content = requirements.read().splitlines()
content = list(set(content))
content.sort(key=lambda y: y.lower())
content = '\n'.join(content)
file = open('sorted_'+requirements_file, 'w')
file.write(content)

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@michaelBenin
michaelBenin / gist:8c4e28f9aa4cacc543e3
Created January 24, 2015 22:46
Extending underscore to extend objects' functions with this._super
// Description:
// Adds this._super method to objects that are extended and have the
// same function, keeps original function as reference on this._super
var _ = require('underscore');
_.extendWithSuper = function(obj) {
if (!_.isObject(obj)) return obj;
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
@michaelBenin
michaelBenin / gist:7187910562916402c307
Created January 27, 2015 19:08
Error output node-sass npm i with node v0.11.14
````
Michaels-Air-2:industryweek-node michaelbenin$ npm i
npm WARN package.json [email protected] querystring is also the name of a node core module.
> [email protected] install /Users/michaelbenin/Projects/industryweek-node/node_modules/core-services-sdk/node_modules/core-service-discovery/node_modules/zkplus/node_modules/bunyan/node_modules/dtrace-provider
> node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
ACTION binding_gyp_libusdt_target_build_libusdt .
Building libusdt for x86_64