Skip to content

Instantly share code, notes, and snippets.

View sbliven's full-sized avatar
💻
Typing...

Spencer Bliven sbliven

💻
Typing...
View GitHub Profile
@sbliven
sbliven / RDS small tags-2025-11-11.user.js
Created November 11, 2025 10:49
A userscript to experiment with modifying the RDS Explorer css. Install with greasemonkey, tampermonkey, or another userscript manager.
// ==UserScript==
// @name RDS Explorer small tags
// @namespace http://tampermonkey.net/
// @version 2025-11-11
// @description Test CSS changes eg to reduce tag size
// @author Spencer Bliven
// @match https://open-research-data-portal.ch/rds-explorer/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=open-research-data-portal.ch
// @grant none
// ==/UserScript==
@sbliven
sbliven / cif2pdb.py
Created April 26, 2017 19:27
Convert mmCIF files to PDB format using biopython
#!/usr/bin/env python
"""
Script to convert mmCIF files to PDB format.
usage: python cif2pdb.py ciffile [pdbfile]
Requires python BioPython (`pip install biopython`). It should work with recent version of python 2 or 3.
@author Spencer Bliven <spencer.bliven@gmail.com>
"""
@sbliven
sbliven / Verben mit festen Präpositionen.md
Created June 9, 2025 19:10
Anki cards for german verbs with fixed prepositions. This markdown file is intended for formatting with the Obsidian Flashcards Plugin.
tags created cards-deck
anki
deutsch
gramatik
präpositionen
2024-04-23
deutsch-b2-präp
digraph G {
layout="neato";
graph [ overlap=false, splines=true ];
subgraph cluster_m {
m00 [ pos="0,0!", label="1"];
m01 [ pos="0,1!", label="1" ];
m02 [ pos="0,2!", label="3" ];
m03 [ pos="0,3!", label="1" ];
m04 [ pos="0,4!", label="4" ];
@sbliven
sbliven / darkmode
Last active November 20, 2024 08:01
Script to toggle dark mode on and off on MacOS
#!/bin/bash
# usage: darkmode [dark|light]
set -euo pipefail
shopt -s nocasematch
if [[ $# > 0 ]]; then
# mode given
case "$1" in
dark)
@sbliven
sbliven / gh_title.js
Last active October 24, 2024 12:46
Custom function for the Obsidian Templater plugin (https://github.com/SilentVoid13/Templater/) to convert a github issue URL to a link with the issue title. Only works for public repos.
async function getGitHubIssueTitle(owner, repo, issueNumber) {
const url = `https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Error fetching issue: ${response.status}`);
}
const issueData = await response.json();
@sbliven
sbliven / index.html
Created August 20, 2024 19:33
Websafe color filter
<!--
SVG filter to make your images look like its 1999!
(Hi Dan!)
-->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 160">
<defs>
<linearGradient id="rainbow" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="100%" y2="0">
<stop offset="0" stop-color="#ff0000"></stop>
<stop offset="0.2" stop-color="#ffff00"></stop>
@sbliven
sbliven / Automata.ipynb
Created May 2, 2024 08:57
Explore 1D Cellular Automata in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sbliven
sbliven / 404ForCaseSensitiveURLs.js
Last active March 16, 2024 09:32 — forked from AmrEldib/404ForCaseSensitiveURLs.js
Jekyll 404 page on GitHub Pages to fix case sensitive URLs
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
sbliven / google-authenticator.rb
Last active March 16, 2024 09:31 — forked from Dan-Q/google-authenticator.rb
Command-line Google Authenticator (TOTP)
#!/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: