Skip to content

Instantly share code, notes, and snippets.

View MattMcFarland's full-sized avatar

Matt McFarland MattMcFarland

  • Software Engineer
  • Dayton, OH
View GitHub Profile
@MattMcFarland
MattMcFarland / test.js
Created November 14, 2015 10:27
BDD - Use with Mocha, Chai, and Selenium
// Start with a webdriver instance:
var
baseUrl = 'localhost:8080',
chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
should = chai.should(),
chaiWebdriver = require('chai-webdriver'),
request = require('supertest')(baseUrl),
sw = require('selenium-webdriver'),

TODOS:

[x] lol

[ ] k

@MattMcFarland
MattMcFarland / .gitignore
Created September 15, 2015 16:13
My .gitignore file (mac os, windows, nodejs, cloud9-ide, jetbrains ide)
# Created by .ignore support plugin (hsz.mobi)
### Linux template
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
### JetBrains template
@MattMcFarland
MattMcFarland / .profile
Last active August 29, 2015 14:25
A sexy bash configuration file for Web Application Developers (MAC OS X 10.10.4 (14E46))
########## Web Application Development for BASH made easy
# This shell script contains a collection of excellent scripts I've found over the years that enhance development.
# It is organized much like a traditional etc/*conf file, and I hope others find it useful.
#
# YOU MUST HAVE X-CODE installed
#
# Features include:
# - Homebrew
# - Sexy git bash status prompt
# - NodeJS Version Manager (nvm)
@MattMcFarland
MattMcFarland / gimmeNodeNow.md
Last active August 29, 2015 14:18
No fuss, just get latest nodejs installed on ubuntu 14.04 damnit

No fuss, no Muss.

Everytime I set up a new ubuntu 14.04 server and I want nodejs globally installed I have to go hunting.

So this just fixes everything.

# hope you ran with sudo

sudo apt-get update
@MattMcFarland
MattMcFarland / couchdbnow.sh
Last active August 29, 2015 14:18
Start up a couch db database for npm registry
#/bin!bash
HOST="http://127.0.0.1:5984"
curl -X PUT $HOST/registry
curl -X PUT $HOST/_config/admins/$1 -d '"$2"'
npm start --npm-registry-couchapp:couch=http://$1:$2@localhost:5984/registry
@MattMcFarland
MattMcFarland / bb-comparator.js
Last active August 29, 2015 14:09
Backbone Comparator Snippet
// This hidden gem was found at http://stackoverflow.com/questions/9865804/proper-way-to-sort-a-backbone-js-collection-on-the-fly (buried in the answers)
// Following example above do in the view:
// Assign new comparator
this.collection.comparator = function( model ) {
return model.get( 'lastname' );
}
// Resort collection
this.collection.sort();
@MattMcFarland
MattMcFarland / webdev-debian.md
Last active August 29, 2015 14:09
debian webdev kit

A web application dev kit for the modern age.

Some things I like to install grom the get-go:

Developer Tools:

I gotta have me some git and compilers to get started, this does the trick:

sudo apt-get install gcc gpp make g++ git -y
@MattMcFarland
MattMcFarland / npm-repair.sh
Created August 19, 2014 22:11
Repair common npm/bower/grunt issues with a single project
#/bin/bash
rm -rf node_modules && rm -rf bower_components
npm cache clean
npm install .
bower install