Skip to content

Instantly share code, notes, and snippets.

View AdamMadrzejewski's full-sized avatar
🎯
Focusing

Adam AdamMadrzejewski

🎯
Focusing
  • Journey Digital
  • Auckland, New Zealand
View GitHub Profile
function reportError(error, message) {
message = message || '';
console.error(
'ERROR: ' + message + ' [' + error.toString() + ']\n' +
'\nName:\t\t' + (error.name || '-') +
'\nMessage:\t' + (error.message || '-') +
'\nFile:\t\t\t' + (error.fileName || '-') +
'\nSource:\t\t' + ((error.toSource && error.toSource()) || '-') +
'\nLine #:\t\t' + (error.lineNumber || '-') +
'\nColumn #:\t' + (error.columnNumber || '-') +
@AdamMadrzejewski
AdamMadrzejewski / uri.js
Last active September 2, 2015 14:25 — 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"