Skip to content

Instantly share code, notes, and snippets.

View michaelBenin's full-sized avatar
🏠
Remote

Michael Benin michaelBenin

🏠
Remote
View GitHub Profile
@michaelBenin
michaelBenin / gist:9037900
Created February 16, 2014 17:45
TODO: Shim config for browserify with bower
var shimConfig = (function (grunt) {
return function (property) {
var shim = {};
var dir = grunt.file.readJSON('package.json').browserDependencies[property].dir;
grunt.file.readJSON('package.json').browserDependencies[property].files
.forEach(function (conf) {
var currentShim = shim[conf.require_by] = {};
currentShim.path = dir + '/' + Object.keys(conf)[0];
currentShim.exports = conf.exports;
if (conf.depends) {
@michaelBenin
michaelBenin / gist:9181690
Created February 24, 2014 03:51
Sample grunt browserify config
browserify: {
modern: {
src: ['client/js/init.js'],
dest: 'built/static/js/<%= pkg.name %>.js',
options: {
debug: true,
noParse: [],
transform: [
'hbsfy'
]
@michaelBenin
michaelBenin / gist:9302474
Created March 2, 2014 05:41
Alphabetize your json file
# python alphabetize-json test.json
import json
import sys
args = sys.argv[1:]
for json_file in args:
with open(json_file, 'r') as file:
alphabetized = json.loads(file.read())
with open(json_file, 'w') as w:
// 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;

1. Clone your fork:

git clone git@github.com: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