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
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;
@abrkn
abrkn / cryptowatch-historical-rates.gs
Last active Mar 20, 2018
Cryptowatch Historical Rates for Google Apps Script
View cryptowatch-historical-rates.gs
// cryptowatch-historical-rates.gs
// Cryptowatch Historical Rates for Google Apps Script
// Version: 1.0
//
// Usage:
// =fetchCryptowatchRateFor("bitfinex", "BCHUSD", "2018-03-01")
// =fetchCryptowatchRateFor("bitfinex", "BCHUSD", "2018-03-01", "open")
// Defaults to closing price
function fetchCryptowatchRateFor(venue, symbol, date, which) {
var index = ['open', 'high', 'low', 'close'].indexOf(which || "close");
@abrkn
abrkn / fetchRippleXrpBalance.js
Created Mar 11, 2018
Fetch the XRP balance of a Ripple account using REST or WebSocket (fallback)
View fetchRippleXrpBalance.js
const assert = require('assert');
const WebSocket = require('ws');
const superagent = require('superagent');
const { get } = require('lodash');
const RIPPLED_URL = 'wss://s2.ripple.com/';
module.exports = async account => {
const websocketMethod = () =>
new Promise((resolve, reject) => {
@abrkn
abrkn / bitfinex-show-annualized-funding-rate.js
Last active Mar 4, 2018
TamperMonkey: Bitfinex Show Annualized Funding Rate
View bitfinex-show-annualized-funding-rate.js
// ==UserScript==
// @name Bitfinex Show Annualized Funding Rate
// @namespace http://brekken.com/
// @version 0.3
// @description Show annualized interest rate for Bitfinex funding.
// @author Andreas Brekken
// @match https://www.bitfinex.com/f/*
// @grant none
// ==/UserScript==
@abrkn
abrkn / coinex-api-node.js
Created Feb 3, 2018
Coinex API client for Node.js
View coinex-api-node.js
// From https://github.com/coinexcom/coinex_exchange_api/wiki/012security_authorization
const request = require('superagent');
const crypto = require('crypto');
const querystring = require('querystring');
const baseUrl = 'https://api.coinex.com/v1';
const USER_AGENT =
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36';
@abrkn
abrkn / install-adobe-creative-cloud.sh
Created Dec 21, 2017
Install Adobe Creative Cloud with minimal user interaction
View install-adobe-creative-cloud.sh
#!/usr/bin/env bash
# Adobe Creative Cloud
if [ ! -d "/Applications/Adobe Creative Cloud/" ]; then
dmg=CreativeCloudInstaller.dmg
dir=$(mktemp -d)
pushd "$dir"
curl -O "https://ccmdls.adobe.com/AdobeProducts/PHSP/19_0_1/osx10-64/AAMmetadataLS20/$dmg"
mkdir -p mount
@abrkn
abrkn / list-of-blockstream-projects-that-fail-to-deliver-bitcoin-scaling.md
Last active Nov 23, 2017
List of BlockStream projects that fail to deliver Bitcoin scaling
View list-of-blockstream-projects-that-fail-to-deliver-bitcoin-scaling.md

List of BlockStream projects that fail to deliver Bitcoin scaling

  • The "Black Box" [1]
  • UASF hats[2]
  • "ASICBOOST" campaign [3]
  • "NO2X"
  • Satellites
  • "DragonMint" [4]

References:

@abrkn
abrkn / index.js
Created Oct 13, 2017
kraken-minimal-trader
View index.js
#!/usr/bin/env node
const assert = require('assert');
const { delay } = require('bluebird');
const BigNumber = require('bignumber.js');
const kraken = require('./kraken');
const {
fetchMyOpenOrders,
fetchOrderBook,
placeOrder,
View gist:61ba2268512da9476629e685036c220d
$ git clone https://github.com/OpenBazaar/openbazaar-go.git
Cloning into 'openbazaar-go'...
...
$ cd openbazaar-go/
You can’t perform that action at this time.