Skip to content

Instantly share code, notes, and snippets.

View listrophy's full-sized avatar

Brad Grzesiak listrophy

View GitHub Profile
@wescarr
wescarr / parseurl.js
Last active December 11, 2015 02:49
Parses a URL and returns an object with the same API as window.location with the addition of a "query" attribute which is a hash of query params. Requires underscore.js
function parseUrl(str) {
var link = document.createElement('a');
link.href = str;
// Parse query string. Strip leading ?, decode, and split
var pairs = /^\??(.*)/.exec(decodeURI(link.search))[1].split('&');
// Split pairs and create object from tuples
var query = _.object(_.invoke(pairs, 'split', '='));
// Other url properties to copy
var props = [
'hash',
@gutenye
gutenye / ember-with-middleman.md
Last active December 10, 2015 01:58
Write Ember.js App With Middleman

I. Create a Middleman project with middleman-ember-template

$ middleman init hello --template=ember

II. Install ember.js package

$ bower install ember