This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='ls --show-control-chars --ignore={NTUSER*,ntuser*} ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.getOwnPropertyNames(Math).map(p=>Object.defineProperty(Number.prototype,p,Math[p].constructor!==Function?{value:Math[p]}:Math[p].length<2?{get(){return Math[p](this)}}:{value(a){return Math[p](this,a)}})) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Y = f => (x => _ => f(x(x))(_))(x => _ => f(x(x))(_)) | |
var fac = f => x => x < 2 ? 1 : x * f(x - 1) | |
var fib = f => x => x < 2 ? x : f(x - 1) + f(x - 2) | |
var a = Array(10).fill().map((_, i) => i) | |
console.log(a.map(Y(fac))) | |
console.log(a.map(Y(fib))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b2hex = buf => Array.from(new Uint8Array(buf)).map(a => {a = a.toString(16); return '00'.slice(a.length) + a }).join('') | |
, digest = buf => crypto.subtle.digest({name: 'SHA-256'}, buf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array(1e6).fill(0).map((a, i) => i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype.eql = function (a) { | |
return this.__proto__ === a.__proto__ && this._eql(a) | |
} | |
Object.prototype._eql = function (a) { | |
return this === a | |
} | |
Array.prototype._eql = function (a) { | |
return this.length === a.length && this.every(function (e, i) { return e === a[i] }) | |
} | |
Number.prototype._eql = function (a) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pw = function () { | |
var arr = new Uint32Array(8) | |
crypto.getRandomValues(arr) | |
return Array.apply([], arr).map(function (x) { | |
x = x.toString(16) | |
return ['00000000'.slice(x.length), x].join('') | |
}).join('') | |
} |