Skip to content

Instantly share code, notes, and snippets.

View SuperSonicHub1's full-sized avatar

Kyle Anthony Williams SuperSonicHub1

View GitHub Profile
@SuperSonicHub1
SuperSonicHub1 / README.md
Last active April 7, 2024 04:00
Run Bibliogram on your Android Phone with Linux

Run Bibliogram on your Android Phone with Linux

Bibliogram running on my Pixel 3a in DuckDuckGo If I find a way to replicate this on iOS with iSH, I'll make sure to update this gist. Thanks to Filip Hejsek for help with compiling libvips.

  1. Install Termux.
  2. Once in the app, run:
pkg install make clang python \ # Satisfy node-gyp: https://github.com/nodejs/node-gyp#on-unix
fish wget netcat \ # Satisfy Bibliogram's updater
@SuperSonicHub1
SuperSonicHub1 / main.py
Last active June 7, 2022 00:11
Bill Iterator for Senator Jabari Brisport
"""Basic script that iterates over a list of bills using the NYS Senate OpenLegislation API:
https://legislation.nysenate.gov/. Requires Requests: `pip install requests`."""
__author__ = "Kyle Williams <[email protected]>"
# https://unlicense.org/
__license__ = "Unlicense"
from csv import DictReader, DictWriter
from os import environ
from requests import Session
@SuperSonicHub1
SuperSonicHub1 / hn-scrape.py
Created April 5, 2022 00:56
Hacker News Scraper
from datetime import datetime
import time
from html.parser import HTMLParser
from html.entities import name2codepoint
import logging
import sqlite3
import traceback
import requests
@SuperSonicHub1
SuperSonicHub1 / extract.sh
Created September 1, 2022 15:55
Scrape Metacritic scores for video games using metacritic
#!/usr/bin/env bash
download-pages() {
local SYSTEM="$1"
wget \
--recursive \
--no-clobber \
--domains www.metacritic.com \
--no-parent \
--wait=2 \
@SuperSonicHub1
SuperSonicHub1 / monads.c
Created January 8, 2023 18:06
Rust's Result and Option monads implemented in C macros
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
#include "monads.h"
// Demonstrate use of Result
enum division_error {
DIVIDE_BY_ZERO,
};
/// https://codeforces.com/contest/1578/problem/H
use std::{str::FromStr, cmp::max, vec};
#[derive(Debug, Clone, PartialEq, Eq)]
enum AST {
Unit,
Paren(Box<AST>),
Func(Box<AST>, Box<AST>),
}
@SuperSonicHub1
SuperSonicHub1 / results.txt
Created April 25, 2023 03:43
What's is the least related thing to MIT?
=== MIT ===
'Ġthe' : 0.27957552671432495
'Ġand' : 0.324958860874176
'Ġin' : 0.3969202935695648
'Ġa' : 0.6269370913505554
'Ġ(' : 0.6961137056350708
=== mit ===
'Ġscoop' : 1.1742193698883057
'Ġtext' : 1.2469427585601807
'Ġon' : 1.2686882019042969
@SuperSonicHub1
SuperSonicHub1 / Coroutine.java
Created June 24, 2023 19:41
Lua-style coroutines in Java for autonomous robot programmng inspired by https://bvisness.me/coroutines/
import java.util.concurrent.atomic.AtomicBoolean;
/**
* https://bvisness.me/coroutines/
*/
public abstract class Coroutine implements Runnable {
AtomicBoolean paused = new AtomicBoolean(false);
private Thread thread;
@SuperSonicHub1
SuperSonicHub1 / bhb.py
Created October 12, 2023 01:56
Synth-sampler hybrid for Winterbloom's Big Honking Button
# We had to patch select_from_list_using_cv LOL
# The MIT License (MIT)
#
# Copyright (c) 2020 Alethea Flowers for Winterbloom
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@SuperSonicHub1
SuperSonicHub1 / code.py
Created March 24, 2024 01:28
USB Remote Start/Stop for WMBR w/ CircuitPython
# Made by Kyle Williams for WMBR, 2024 M03
# This code is public domain under the Unlicense: https://unlicense.org/
import usb_hid
import usb_midi
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
import adafruit_midi
from adafruit_midi.start import Start
from adafruit_midi.stop import Stop