Skip to content

Instantly share code, notes, and snippets.

@learntheropes
learntheropes / btcAddrRegex.txt
Last active July 12, 2017 22:17
Regular expression matching Bitcoin address
^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$
Verifying that +consfuso is my blockchain ID. https://onename.com/consfuso
@learntheropes
learntheropes / poloniex_private_api.gs
Last active June 2, 2019 01:18
Poloniex private API for Google Apps Script (Google Sheet)
// work in progress
// you need a poloniex API key and secret with trading option enabled
// you can test it with:
// = polo("returnBalances","BTC")
// or
// = polo("returnBalances","all")
// or buy and sell:
// polo("BUY","BTC_LTC", 0.0251, 1) or polo("SELL","BTC_LTC", 0.0251, 1)
@learntheropes
learntheropes / bittrex_private_and_public_api.gs
Last active March 3, 2021 08:57
Bittrex private and public API for Google Apps Script (Google Sheet)
// work in progress
// you need a bittrex API key and secret with read account option enabled
// I assume that all the keys are in the "keys" spreadsheet. The key is in cell B5 and the secret in cell C5
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("keys");
var key = sheet.getRange("B5").getValue()
var secret = sheet.getRange("C5").getValue();
var baseUrl = 'https://bittrex.com/api/v1.1/';
var nonce = Math.floor(new Date().getTime()/1000);
user_agent_parsers:
#### SPECIAL CASES TOP ####
# CFNetwork Podcast catcher Applications
- regex: '(ESPN)[%20| ]+Radio/(\d+)\.(\d+)\.(\d+) CFNetwork'
- regex: '(Antenna)/(\d+) CFNetwork'
family_replacement: 'AntennaPod'
- regex: '(TopPodcasts)Pro/(\d+) CFNetwork'
- regex: '(MusicDownloader)Lite/(\d+)\.(\d+)\.(\d+) CFNetwork'
- regex: '^(.*)-iPad/(\d+)\.?(\d+)?.?(\d+)?.?(\d+)? CFNetwork'

Lua, Luarocks, Moonscript, Lapis and dependencies

sudo apt-get install git lua5.1 luarocks libssl1.0.0 libssl-dev
sudo luarocks install lapis
sudo luarocks install moonscript

Openresty

sudo apt-get install libpcre3-dev libssl-dev perl make build-essential curl
### Keybase proof
I hereby claim:
* I am coinfused on github.
* I am coinfused (https://keybase.io/coinfused) on keybase.
* I have a public key ASAoLXqKwlmqweyi_UDxcKY6rcies_QZ89jC1ow2noZFDQo
To claim this, I am signing this object:
@learntheropes
learntheropes / isEmpty.js
Last active February 4, 2022 07:49
isEmpty and isFinite functions
function isEmpty(value){
return value === undefined ||
value === null ||
(typeof value === "object" && Object.keys(value).length === 0) ||
(typeof value === "string" && value.trim().length === 0)
}
module.exports = isEmpty;
@learntheropes
learntheropes / 1_virtualbox.sh
Last active April 15, 2019 15:02
Influxdb Kubernetes locally
sudo apt-get update && sudo apt-get install -y apt-transport-https
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt update
sudo apt install virtualbox-6.0
sudo /etc/init.d/docker status
#Create new docker group (in case the previous one is not exist)
sudo groupadd docker
#groupadd: group ‘docker’ already exists
#add your current logged in user t the docker group
sudo usermod -aG docker $USER
#Restart docker daemon / service