This file contains hidden or 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
// @ts-check | |
function delay(ms) { | |
return new Promise((resolve) => { | |
setTimeout(resolve, ms); | |
}); | |
} | |
function avgColor(data, x0, y0, width, height, dist) { | |
const color = [0, 0, 0, 0]; | |
for (let y = 0; y < dist; y++) { |
This file contains hidden or 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
// node electron | |
const { remote } = require('electron') | |
const currentWindow = remote.getCurrentWindow() | |
// document.addEventListener('mousedown', function() { | |
// remote.BrowserWindow.getAllWindows().forEach(function(win) { | |
// win.webContents.openDevTools({mode: 'detach'}); | |
// }); | |
// remote.getCurrentWindow().getBrowserView().webContents.openDevTools({mode: 'detach'}); |
This file contains hidden or 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
// 100,000,000 satoshi = 1 btc | |
// 100,000 satoshi = 0.001 btc = 1e5 | |
const bitcoin = require('bitcoinjs-lib'); | |
const network = bitcoin.networks.bitcoin; | |
const blockchainInfoNetwork = network === bitcoin.networks.bitcoin ? 0 : 3; // bitcoin or testnet | |
const blockexplorer = require('blockchain.info/blockexplorer').usingNetwork(blockchainInfoNetwork); | |
const pushtx = require('blockchain.info/pushtx').usingNetwork(blockchainInfoNetwork); | |
const sourceWIF = ''; // put private key here |
This file contains hidden or 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
// 100,000,000 satoshi = 1 btc = 1e8 satoshi | |
// 100,000 satoshi = 0.001 btc = 1e5 satoshi | |
const bitcoin = require('bitcoinjs-lib'); | |
const network = bitcoin.networks.bitcoin; | |
const blockchainInfoNetwork = network === bitcoin.networks.bitcoin ? 0 : 3; // bitcoin or testnet | |
const blockexplorer = require('blockchain.info/blockexplorer').usingNetwork(blockchainInfoNetwork); | |
const pushtx = require('blockchain.info/pushtx').usingNetwork(blockchainInfoNetwork); | |
// const destAddr = 'mfdC1bTbar2WVAkmSMjejyiFFp6Rtyq8vW'; // testnet |