Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
const { Transaction } = require('bitcore-lib') | |
const { decrypt } = require('bip38') | |
const encryptedKey = '<private key beginning with 6>' | |
const password = '<private key password>' | |
const privateKey = decrypt(encryptedKey, password).privateKey | |
// Check UTXO info at https://insight.bitpay.com/api/addr/<origin address>/utxo | |
const utxo = { |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
var iterations = 0 | |
var print_board = function (columns) { | |
var n = columns.length, row = 0, col = 0 | |
while (row < n) { | |
while (col < n) { | |
process.stdout.write(columns[row] === col ? 'Q ' : '# ') | |
col++ | |
} |
Download the latest Raspberry Pi OS Lite image from https://www.raspberrypi.com/software/operating-systems/ (2022-04-04 at the time of this writing).
Insert your microSD card. Use Raspberry Pi Imager to burn the image to your microSD card. Make to select "Set username and password" in the config before starting. Name the user pi
and select your own password.
Ensure the disk is mounted again, then enable SSH.
$ touch /Volumes/boot/ssh
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |