Skip to content

Instantly share code, notes, and snippets.

View abrkn's full-sized avatar

Andreas Brekken abrkn

View GitHub Profile
@abrkn
abrkn / drivechain-install-linux.sh
Last active October 31, 2018 04:10
Automatic installation of Drivechain TestDrive
#!/usr/bin/env bash
# AutoTestDrive v7
# Automation Drivechain TestDrive installation for Ubuntu
# Uses Drivenet-9, UTXO-7, Sidechain-8, Payment-1
#
# Changelog
#
# Revision 8
# - Do not restore wallet unless revision 8
# - Fix typo in wallet restore code (payment restored sidechain wallet)
@abrkn
abrkn / drivechain.ai.md
Created October 22, 2018 09:23
Welcome to Drivechain.ai

Drivechain.ai

Drivechain.ai is a toolkit created by Andreas Brekken to make getting started and using the Drivechain TestDrive easier and more fun.

Services

#!/usr/bin/env node -r panik -r dotenv/config
const assert = require('assert');
const { URL } = require('url');
const redis = require('redis');
const bitcoin = require('bitcoin');
const safync = require('./safync');
const { urlToBitcoinOptions } = require('./utils');
const Promise = require('bluebird');
const { pMemoize } = require('./pmr');
const pgp = require('pg-promise');
import assert from 'assert';
import createDebug from 'debug';
const debug = createDebug(`sane-jest`);
const theirDescribe = describe;
const theirTest = test;
const defaultTimeout = +(process.env.SANE_JEST_TIMEOUT || 30e3);
import assert from 'assert';
import createDebug from 'debug';
const debug = createDebug(`sane-jest`);
const theirDescribe = describe;
const theirTest = test;
const defaultTimeout = +(process.env.SANE_JEST_TIMEOUT || 30e3);
@abrkn
abrkn / lnd.shitcoin.com.md
Last active July 17, 2018 06:21
How to connect to lnd.shitcoin.com

Do you run a Bitcoin Lightning Network node? Connect to lnd.shitcoin.com for the fastest and cheapest transaction routing!

How to connect

For LND users:

lncli connect 036b32ac6acf6d178f47c2139b7327ab85bd3d5f5c40681a9a48109ea21f53e1e5@lnd.shitcoin.com:9735

For c-lightning users:

@abrkn
abrkn / bitfinex-limiter.js
Created July 5, 2018 03:27
Bitfinex Rate Limiting
import { RateLimiter } from 'limiter';
import createDebug from 'debug';
const debug = createDebug('koh:bitfinex:limiter');
const LOWER_MAX_REQUESTS_PER_MINUTE = 10;
const UPPER_MAX_REQUESTS_PER_MINUTE = 90;
const MIN_TOKENS_PER_MINUTE = 1;
const MAX_TOKENS_PER_MINUTE = UPPER_MAX_REQUESTS_PER_MINUTE / LOWER_MAX_REQUESTS_PER_MINUTE;
const DEFAULT_TOKENS_PER_MINUTE = (MIN_TOKENS_PER_MINUTE + MAX_TOKENS_PER_MINUTE) / 2;
@abrkn
abrkn / tampermonkey-autofill-memo-password.js
Last active April 19, 2018 05:51
Auto-fill Memo.cash Password with Tampermonkey for Chrome
// ==UserScript==
// @name Auto-fill Memo-cash password
// @namespace https://tampermonkey.net/
// @version 0.2
// @description Auto-fill Memo.cash Password with Tampermonkey for Chrome
// @author Andreas Brekken: https://memo.cash/profile/149o1esm1LrYEy1DizZgxANSppx3FESHKw
// @match https://memo.cash/*
// @grant none
// ==/UserScript==
@abrkn
abrkn / andreas-brekken.txt
Created April 19, 2018 03:53
Andreas Brekken social media accounts (PGP signed)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
PGP Fingerprint: 1C02 44DB 388D 7395 FFA1 147E ED08 98C4 A8B3 F140
Twitter: @abrkn
Memo.cash: https://memo.cash/profile/149o1esm1LrYEy1DizZgxANSppx3FESHKw
Telegram: @brekken
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org
@abrkn
abrkn / derp.gs
Last active April 18, 2018 00:54
var ISO_DATE_SUFFIX = 'T00:00:00';
var SLEEP_BEFORE_FETCH = 2000;
var cache = CacheService.getDocumentCache();
function fetchWithCache(url) {
var raw = cache.get(url);
if (raw) {
return raw;