Not catching an error is perfectly fine, if it's something that shouldn't happen just let it fall through and cause a 500 so we know to fix it
Most of the time when you catch an error you want to map from an infrastructure
function stringProduct(n1, n2) { | |
return toString(toInt(n1) * toInt(n2)) | |
} | |
const CHAR_0 = "0".charCodeAt(0) // 48 | |
function toInt(str) { | |
return [...str].reverse().reduce((acc, c, i) => { | |
return acc + BigInt(c.charCodeAt(0) - CHAR_0) * (10n**BigInt(i)) | |
}, 0n) |
(function () { | |
const canvas = document.createElement('canvas'); | |
canvas.style = 'position: fixed; top: 0; right: 0; z-index: -100;' | |
// const canvas = document.getElementById('background'); | |
function charRange(start, len) { | |
let chars = []; |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# bash <(curl -sL http://mywebsite.com/myscript.txt) | |
set -e | |
sudo systemsetup -setremotelogin on | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew cask install anybar keepingyouawake | |
echo -n '[email protected] apple password: ' | |
read -s PASSWORD |
function universalMapper(obj, fn) { | |
if (!obj) return obj; | |
if (Array.isArray(obj)) return obj.map(fn); | |
return fn(obj); | |
} |
bitbucket.com
$ dig bitbucket.com
; <<>> DiG 9.8.3-P1 <<>> bitbucket.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25393
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
function Colourizer (colors) { | |
this._colors = colors; | |
} | |
Colourizer.prototype.getStringColor = function (str) { | |
var letters = str.split(''); | |
return this._colors[letters.reduce(function (n, c) { | |
return n + c.charCodeAt(0) |