Skip to content

Instantly share code, notes, and snippets.

Parsing Apple Health data

If you’ve ever wanted to analyze your own health data, here’s how.

Exporting as XML

  1. Open the Health app.
  2. Tap on your profile in the top right.
  3. Tap Export All Health Data.
  4. Share the archive with yourself (e.g. via AirDrop, Files, Mail, etc.).

PKI for busy people

Public-key infrastructure (PKI) is an umbrella term for everything that has to do with keys and certificates.

This is a quick overview of the important stuff.

Public-key cryptography

Public-key cryptography involves a key pair: a public key and a private key. Each entity has their own. The public key can be shared around, the private key is secret.

@hoffa
hoffa / cqueue.py
Last active December 1, 2020 14:41
class CQueue:
def __init__(self, k=0.5):
self.q = []
self.m = 0
self.k = k
def enqueue(self, v):
self.q.append(v)
def dequeue(self):
@hoffa
hoffa / unicode.py
Last active December 2, 2020 21:50
import sys
import unicodedata
for c in sys.stdin.read():
utf8 = c.encode("utf-8").hex().upper()
code_point = ord(c)
name = unicodedata.name(c, "")
print(f"{c}\t0x{utf8}\tU+{code_point:04X}\t{name}")