Skip to content

Instantly share code, notes, and snippets.

View andersk's full-sized avatar

Anders Kaseorg andersk

View GitHub Profile
@andersk
andersk / purpleair.10m.py
Created September 1, 2020 20:50
Argos script to monitor AQI from PurpleAir
#!/usr/bin/env python
import json
from datetime import datetime
import requests
SENSOR_ID = 4372
data = requests.get("https://www.purpleair.com/json", {"show": SENSOR_ID}).json()
result = data["results"][0]
@andersk
andersk / check-ubuntu-version-monotonicity.py
Last active July 6, 2018 04:04
check-ubuntu-version-monotonicity
#!/usr/bin/python3
import apt_pkg
import debian.deb822
import gzip
import sys
from io import BytesIO
from ubuntutools.lp.lpapicache import Distribution
from urllib.request import urlopen
COMPONENTS = ["main", "restricted", "universe", "multiverse"]
@andersk
andersk / blockstack.txt
Created November 2, 2017 05:37
Blockstack proof
Verifying my Blockstack ID is secured with the address 1CeTh4qPiCrs57JwpeQuWYM9spvCdungNp https://explorer.blockstack.org/address/1CeTh4qPiCrs57JwpeQuWYM9spvCdungNp
@andersk
andersk / flowsnake.hs
Last active August 29, 2015 14:21
Flowsnake
-- http://codegolf.stackexchange.com/questions/50521/ascii-art-of-the-day-2-flow-snakes
import Control.Applicative -- not needed in GHC 7.10
(?)=div
(%)=mod
t[a,b]=[3*a+b,2*b-a]
_#[0,0]=0
0#_=3
n#p=[352,6497,2466,-1]!!((n-1)#t[(s+3)?7|s<-p])?(4^p!!0%7)%4
Verifying that +andersk is my Bitcoin username. You can send me #bitcoin here: https://onename.io/andersk
@andersk
andersk / keybase.md
Created April 1, 2014 04:57
Keybase proof

Keybase proof

I hereby claim:

  • I am andersk on github.
  • I am andersk (https://keybase.io/andersk) on keybase.
  • I have a public key whose fingerprint is 6A3C 67D7 F011 900C C539 248B DFF3 AB37 4F16 F73A

To claim this, I am signing this object: