Skip to content

Instantly share code, notes, and snippets.

View iwalton3's full-sized avatar

Izzie Walton iwalton3

View GitHub Profile
@iwalton3
iwalton3 / clear-watched.js
Last active July 19, 2023 14:40
Clear Watched (for when you get 502 errors trying to remove watched videos from your YouTube watched later)
window.setInterval(
async() => {
let f = document.querySelector('.ytd-playlist-video-renderer .ytd-thumbnail-overlay-resume-playback-renderer');
if (f) {
f = f.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.querySelector('#menu yt-icon-button');
}
if (!f) {
f = document.querySelector('.ytd-playlist-video-renderer img[src="https://i.ytimg.com/img/no_thumbnail.jpg"]');
if (f) {
f = f.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.querySelector('#menu yt-icon-button');
@iwalton3
iwalton3 / ai-friend-exllama.py
Created May 31, 2023 02:32
Discord Exllama Chatbot
#!/usr/bin/env python3
from model import ExLlama, ExLlamaCache, ExLlamaConfig
from tokenizer import ExLlamaTokenizer
from generator import ExLlamaGenerator
import argparse
import torch
from timeit import default_timer as timer
torch.set_grad_enabled(False)
torch.cuda._lazy_init()
@iwalton3
iwalton3 / data-format.json
Created May 12, 2023 03:52
Message Splitter - Split chat messages into chunks for training GPTs
{
"data": "%data%"
}
@iwalton3
iwalton3 / jmpapi.ts
Last active March 15, 2023 05:07
Prototype Jellyfin Media Player Typescript API
interface JMPSettings {
appleremote: {
emulatepht: boolean;
};
audio: {
channels: 'auto' | '2.0' | '5.1,2.0' | '7.1,5.1,2.0';
/**
* auto or device name
*/
device: string;
@iwalton3
iwalton3 / jellyfin-cotton-candy.css
Last active March 13, 2023 22:33
Jellyfin Cotton Candy Theme
* {
scrollbar-width: thin;
}
.skinHeader,
html {
color: #222;
color: rgba(0, 0, 0, 0.87);
}
@iwalton3
iwalton3 / jellyscrubPluginHLS.js
Created February 21, 2023 04:38
Replacement "jellyscrubPlugin.js" for experimental HLS version of Jellyscrub.
class jellyscrubPlugin {
constructor({ playbackManager, events }) {
this.name = 'Jellyscrub Plugin';
this.type = 'input';
this.id = 'jellyscrubPlugin';
(async() => {
const api = await window.apiPromise;
const enabled = await new Promise(resolve => {
api.settings.value('plugins', 'jellyscrub', resolve);
@iwalton3
iwalton3 / BME280.py
Created June 11, 2022 05:08
ESP8266 BME280
from machine import I2C
import time
# BME280 default address.
BME280_I2CADDR = 0x76
# Operating Modes
BME280_OSAMPLE_1 = 1
BME280_OSAMPLE_2 = 2
BME280_OSAMPLE_4 = 3
@iwalton3
iwalton3 / boot.py
Created May 8, 2022 03:27
Window Fan Controller
# This file is executed on every boot (including wake-boot from deepsleep)
import gc
import ubinascii
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
if not sta_if.isconnected():
print('connecting to network...')
@iwalton3
iwalton3 / idx_blob.py
Last active September 6, 2021 01:38
Blob Indexer/Reassembler
#!/usr/bin/env python3
import os
import os.path
import sys
import json
import math
print("Collecting files...")
files = {}
@iwalton3
iwalton3 / c.sh
Created April 22, 2021 16:51
Quick "cd from anywhere" alias
function c {
while read -r _ dir
do
if [[ -e "$dir" ]]
then
echo "$dir"
cd "$dir"
break
fi
done < <(cat ~/.full_history | tail -n 10000 \