Skip to content

Instantly share code, notes, and snippets.

@jhuckaby
jhuckaby / subl.pl
Created July 8, 2012 03:37
A better subl for launching Sublime Text 2 via the command-line (forces file to open in new window)
#!/usr/bin/perl
# A replacement for Sublime Text 2's built-in "subl" command-line utility,
# which forces files into new windows regardless of prefs.
# by Joseph Huckaby, 2012
use strict;
use Cwd qw/abs_path/;
use FileHandle;
@jhuckaby
jhuckaby / parseQueryString.js
Last active September 26, 2015 16:28
Parse query string into key/value pairs and return as object
function parseQueryString(url) {
// parse query string into key/value pairs and return as object
var query = {};
url = (url || location.search).replace(/^.*\?/, '').replace(/([^\=]+)\=([^\&]*)\&?/g, function(match, key, value) {
query[key] = decodeURIComponent(value);
return '';
} );
return query;
}