Skip to content

Instantly share code, notes, and snippets.


Spencer Bliven sbliven

Block or report user

Report or block sbliven

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 Apr 26, 2017
Convert mmCIF files to PDB format using biopython
#!/usr/bin/env python
Script to convert mmCIF files to PDB format.
usage: python ciffile [pdbfile]
Requires python BioPython (`pip install biopython`). It should work with recent version of python 2 or 3.
@author Spencer Bliven <>
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
"""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 / 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:
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 / 404ForCaseSensitiveURLs.js
Last active Dec 26, 2018 — forked from AmrEldib/404ForCaseSensitiveURLs.js
Jekyll 404 page on GitHub Pages to fix case sensitive URLs
View 404ForCaseSensitiveURLs.js
var allposts = [];
function redirectToCorrectPage() {
console.log("Unable to find page. Trying other URL cases.");
{% for post in site.pages %}
allposts.push("{{ post.url }}");
{% endfor %}
var url = window.location.pathname;
// strip trailing /
if (url.slice(-1) === "/") {
url = url.slice(0, -1);
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 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 / 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.
You can’t perform that action at this time.