Skip to content

Instantly share code, notes, and snippets.

View snapo's full-sized avatar

snapo

View GitHub Profile

Intermediate Python for Finance Training

This is the Gist for Day 1 of the Intermediate Python for Finance Training in London, 28. November 2017

Agenda

Module 1 — Python

@snapo
snapo / curve_example.py
Last active January 22, 2020 12:58 — forked from nlitsme/curve_example.py
example of bitcoin curve calculations in python
"""
Example of how calculations on the secp256k1 curve work.
secp256k1 is the name of the elliptic curve used by bitcoin
see http://bitcoin.stackexchange.com/questions/25382
"""
p = 2**256 - 2**32 - 977
@snapo
snapo / btc_gold_correlation.py
Created January 22, 2020 13:25 — forked from mostlyinteresting/btc_gold_correlation.py
Rolling 30 day correlation of BTC with gold
import os
import pandas as pd
import datetime as dt
import seaborn as sns
import matplotlib.pyplot as plt
import ccxt
sns.set(style = 'ticks', context = 'talk')
plt.style.use("dark_background")
@snapo
snapo / btc_max_dd.py
Created January 22, 2020 13:25 — forked from mostlyinteresting/btc_max_dd.py
Rolling n Year Max DD for BTC
import os
import pandas as pd
import datetime as dt
import seaborn as sns
import matplotlib.pyplot as plt
import ccxt
from dateutil import relativedelta
import numpy as np
sns.set(style = 'ticks', context = 'talk')
@snapo
snapo / capture.py
Created January 23, 2020 11:57 — forked from jefftriplett/capture.py
Using Python 3, selenium, and headless chrome ala chromedriver to capture website screenshots
"""
To install:
# python requirements
$ pip install click selenium
# for headless chrome
$ brew install chromedriver
To use:
$ python capture.py https://revsys.com revsys.png

CadQuery Shape primitives


3d shapes

Box

Workplane.box

result = cq.Workplane("XY" ).box(3, 3, 3)

07