I hereby claim:
- I am sstur on github.
- I am sstur (https://keybase.io/sstur) on keybase.
- I have a public key whose fingerprint is 71E5 0A75 B701 F9DC F7F2 55C0 F227 C435 01EE 9CAE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
(function() { | |
if (window.document.querySelector && window.document.body) { | |
if (!window.console) { | |
window.console = {}; | |
} | |
if (!("log" in console)) { | |
/** | |
* @return {undefined} | |
*/ | |
console["log"] = function() { |
var f = function() { | |
if (a) { | |
this.add('x' + a + ':function()'); | |
} else { | |
this.part.is.not.correctly.syntax.highlighted(); | |
} | |
}; |
(function() { | |
var rows = Array.prototype.filter.call(document.querySelectorAll('.player-list-table tr'), function(row) { | |
return !row.classList.contains('positionFilterApplied'); | |
}); | |
var results = rows.map(function(row) { | |
return [ | |
row.querySelector('.player-position').firstChild.nodeValue, | |
row.querySelector('.player-name').firstChild.firstChild.nodeValue, | |
row.querySelector('.player-salary').firstChild.nodeValue | |
].join('\t') |
function UTCDate(a) { | |
var x; | |
switch (arguments.length) { | |
case 0: | |
x = new Date(); | |
break; | |
case 1: | |
x = (typeof a === 'number') ? new Date(a) : new Date(Date.parse(a)); | |
break; | |
default: |
function MyDate(a, b, c, d, e, f, g) { | |
var date; | |
switch (arguments.length) { | |
case 0: | |
date = new Date(); | |
break; | |
case 1: | |
date = new Date(a); | |
break; | |
case 2: |
function MyArray() { | |
var array = []; | |
if (arguments.length) { | |
array.push.apply(array, arguments); | |
} | |
// note: use `Object.setPrototypeOf` instead of __proto__ to be truly standards-compliant | |
array.__proto__ = MyArray.prototype; | |
return array; | |
} |
function typeOf(o) { | |
var type = (o === null) ? 'null' : typeof o; | |
return (type == 'object') ? Object.prototype.toString.call(o).slice(8, -1).toLowerCase() : type; | |
} | |
//Example: typeOf(new Date()) => 'date' |
RegExp.escape = function(str) { | |
return str.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); | |
} | |
//Example: string.replace(new RegExp(RegExp.escape('a&b'), 'g'), 'c&d') | |
//Credit: http://simonwillison.net/2006/Jan/20/escape/#p-6 |
function formatNumber(val) { | |
return String(val).replace(/\B(?=(\d{3})+(?!\d))/g, ','); | |
} | |
//formatNumber('1000000') => '1,000,000' |