Skip to content

Instantly share code, notes, and snippets.

@rynote
rynote / marty.py
Created April 29, 2015 00:47
Use this to see how long your initial investment in a dice game will last :P
#Use this to see how long your initial investment in a dice game will last :P
import sys
def sats2btc(sats):
return sats/100000000.0
def btc2str(btc):
return "{:1.8f}".format(btc)

Keybase proof

I hereby claim:

  • I am rynote on github.
  • I am ryango (https://keybase.io/ryango) on keybase.
  • I have a public key whose fingerprint is 7015 4375 4E76 8CD5 6DFA 50F3 4DB3 0CC0 1C7C 74D3

To claim this, I am signing this object:

@rynote
rynote / BASH_Bittrex_Fun.sh
Created December 4, 2017 19:47
BASH commands for grabbing Bittrex exchange rates
#Bittrex fun Bash commands:
#requires 'curl', 'jq' and 'bc'
#To get a quote from bittrex and return it as BTC
curl -s https://bittrex.com/api/v1.1/public/getticker?market=BTC-MEME | jq '.["result"]["Last"]' | awk '{ print sprintf("%.8f", $1); }'
#To get USDT price of BTC at bittrex
curl -s https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC | jq '.["result"]["Last"]' | awk '{ print sprintf("%.2f", $1); }'
#One-liner to get quote and convert it to USD via USDT-BTC rate
@rynote
rynote / q.sh
Created December 29, 2017 03:02
#pass coin as argument and get price converted via btc-usdt rate
#ie. ./q.sh meme
#requires bc and jq
echo `curl -s https://bittrex.com/api/v1.1/public/getticker?market=btc-$1 | jq '.["result"]["Last"]' | awk '{ print sprintf("%.8f", $1); }'`"*"`curl -s https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC | jq '.["result"]["Last"]' | awk '{ print sprintf("%.2f", $1); }'` | bc -l
@rynote
rynote / bq.sh
Last active January 7, 2018 07:35
#pass coin as argument and get price converted via btc-usdt rate
#ie. ./bq.sh enj
#requires bc and jq
echo `a=$1; A=$(echo $a | tr [a-z] [A-Z]);A=$(echo -n $A; echo -n BTC);curl -s https://api.binance.com/api/v3/ticker/price?symbol=$A | jq '.["price"]' | sed 's/"//g'`"*"`curl -s https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC | jq '.["result"]["Last"]' | awk '{ print sprintf("%.2f", $1); }'` | bc -l
@rynote
rynote / AE_Javascript_FormatNumberWithCommas.txt
Last active May 16, 2019 18:13
After Effects Javascript expression to format a number with commas.
val = Math.floor(thisComp.layer("SET NUMBER as Point X").effect("val")("Point")[0]);//a Point Expression Control let's you use bigger numbers than a Slider.
Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@rynote
rynote / kcrwTopTune_grabber.sh
Created November 11, 2020 20:10
Download the free daily 'Top Tune' from KCRW 89.9 FM automatically
#!/bin/sh
# run daily at 10am via crontab:
#0 10 * * 1-5 cd /home/pi/scripts && ./kcrwTopTune_grabber.sh
cd /home/pi/Music/KCRW_Todays_Top_Tune
wget -q "$(curl -s https://www.kcrw.com/music/shows/todays-top-tune | grep .mp3 | awk -F '"' '{print $2}')"
{
"success":true,
"asset":"GRUMPYCAT",
"asset_issuer_address":"1Lfm6jXgCQi8LvjpgFHa2F4hdr1uJVa5t4",
"asset_owner_address":"1Lfm6jXgCQi8LvjpgFHa2F4hdr1uJVa5t4",
"asset_supply":"100",
"asset_divisible":false,
"asset_locked":false,
"image":"https:\/\/coindaddy.io\/content\/images\/icons\/xcp\/grumpycat.png",
"description":"The Grumpycat Asset is a fun asset that is being used to demonstrate the coindaddy.io asset services. To see the grumpycat asset being registered and enhanced you should visit the coindaddy website at coindaddy.io",