Skip to content

Instantly share code, notes, and snippets.

View mttjhn's full-sized avatar

Matthew Johnson mttjhn

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1KTw9bg9Q4Yf2VXkUdVVwtFa81L5ZnvvUs https://explorer.blockstack.org/address/1KTw9bg9Q4Yf2VXkUdVVwtFa81L5ZnvvUs
@mttjhn
mttjhn / BookPctCalc.py
Last active February 16, 2018 17:40
A quick Pythonista script (with UI elements) to calculate the percentage complete on a book with irregular page numbering.
import ui
import console
def calcPercent(total, start, current):
pct = (current - start + 1) / (total - start + 1)
return round(pct * 100, 1)
def buttonClick(sender):