Skip to content

Instantly share code, notes, and snippets.

Andreas Brekken abrkn

Block or report user

Report or block abrkn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@abrkn
abrkn / drivechain.ai.md
Created Oct 22, 2018
Welcome to Drivechain.ai
View drivechain.ai.md

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

View postgres-index.js
#!/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');
@abrkn
abrkn / drivechain-install-linux.sh
Last active Oct 31, 2018
Automatic installation of Drivechain TestDrive
View drivechain-install-linux.sh
#!/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)
View sane-jest.js
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);
View sane-jest.js
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 Jul 17, 2018
How to connect to lnd.shitcoin.com
View lnd.shitcoin.com.md

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 Jul 5, 2018
Bitfinex Rate Limiting
View bitfinex-limiter.js
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 Apr 19, 2018
Auto-fill Memo.cash Password with Tampermonkey for Chrome
View tampermonkey-autofill-memo-password.js
// ==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 Apr 19, 2018
Andreas Brekken social media accounts (PGP signed)
View andreas-brekken.txt
-----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
View derp.gs
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;
You can’t perform that action at this time.