Skip to content

Instantly share code, notes, and snippets.

View antonlvovych's full-sized avatar

Anton Fedulov antonlvovych

View GitHub Profile
@antonlvovych
antonlvovych / uri-parser.js
Last active October 22, 2015 22:23 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
// A list of possible usernames to reserve to avoid
// vanity URL collision with resource paths
// It is a merged list of the recommendations from this Quora discussion:
// http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
// Country TLDs found here:
// http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains//Country_code_top-level_domains
// Languages found here: