Skip to content

Instantly share code, notes, and snippets.


Spencer Bliven sbliven

View GitHub Profile
sbliven / 99_telegram
Created Nov 7, 2017
Raspberry Pi setup to send IP changes via telegram
View 99_telegram
# /lib/dhcpcd/dhcpcd-hooks/99-telegram
# Notify telegram chat of ip changes
# man dhcpcd-run-hooks for variables
if $if_up; then
case "$reason" in
sbliven /
Created Dec 5, 2017
Script to show current IP address on SenseHat
from sense_hat import SenseHat
import socket
def get_ip():
# overridden by /etc/hosts, so doesn't work for us
#hosts_ips = [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1]
# try to connect to google
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('', 53))
sbliven / nab2ynab.R
Created Dec 11, 2017
Convert bank transaction data from Neue Aargauer Bank CSV files to the format expected by
View nab2ynab.R
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
if (length(args) != 2) {
stop("usage: nab2ynab.R nab.csv ynab.csv", call.=FALSE)
sbliven / Lunar Lander.ipynb
Last active Mar 6, 2018
Calculations for DanQ's Lunar Lander game (
View Lunar Lander.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sbliven /
Created Mar 28, 2018
ODC Public Domain Dedication and Licence (PDDL)

ODC Public Domain Dedication and Licence (PDDL)

A lay explaination of this license is available at The full legal text is also available online at


The Open Data Commons – Public Domain Dedication & Licence is a document intended to allow you to freely share, modify, and use this work for any purpose and without any restrictions. This licence is intended for use on databases or their contents (“data”), either together or individually.

Many databases are covered by copyright. Some jurisdictions, mainly in Europe, have specific special rights that cover databases called the “sui generis” database right. Both of these sets of rights, as well as other legal rights used to protect databases and data, can create uncertainty or practical difficulty for those wishing to share databases and their underlying data but retain a limited amount of rights under a “some rights reserved” approach to licensing as

sbliven / Sync Calendars.scpt
Created Dec 17, 2018
Copies events between calendars in Apple
View Sync Calendars.scpt
-- Syncronize several calendars
-- The calendars to be synced must be set by UID in the 'targetCalendarIDs' variable.
-- UIDs can be read using the 'Get Calendar' script.
-- When run, copies each selected event to other calendars in the target list.
-- Author: Spencer Bliven (
-- Event selection code from
sbliven /
Created Feb 6, 2019
Generate evenly-spaced heic file for testing Mac dynamic wallpapers
#!/usr/bin/env bash
set -euo pipefail
for ((a=-90;a<=90;a+=10)); do
for ((z=0; z<360; z+=10)); do
sbliven / google-authenticator.rb
Last active Mar 8, 2019 — forked from Dan-Q/google-authenticator.rb
Command-line Google Authenticator (TOTP)
View google-authenticator.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: utf-8
# TOTP implementation (google authenticator)
# Reads ~/.google-authenticator-accounts for account info.
# For security, you should run `chmod 600 ~/.google-authenticator-accounts
# Changelog:
"""Create distribution of line lengths over files
find . -regextype egrep -regex './(Bio|Tests)/.*\.py' -type f -exec \
python --hist linelengths.png \
--cdf linelengthscumulative.png -v '{}' '+'
import sys
sbliven /
Last active Sep 11, 2019
Test a difficult typing case. Python type annotations!
"""Test a difficult typing case.
Inspired by biopython's Bio.PDB.Entity.
import sys
from typing import TypeVar, Union
You can’t perform that action at this time.