Skip to content

Instantly share code, notes, and snippets.

View Vocaned's full-sized avatar
🐦‍⬛

Vocaned Vocaned

🐦‍⬛
View GitHub Profile
// Set up some prerequisites
if (typeof buttplug === 'undefined') {
throw 'error: Buttplug.js library not found. Please follow the usage instructions carefully.'
}
if (typeof _mods === 'undefined') {
var _mods; webpackChunkdiscord_app.push([[Symbol()], {}, r => _mods = r.c]);
webpackChunkdiscord_app.pop();
}
if (typeof findByProps === 'undefined') {
var findByProps = (...props) => {
We couldn’t find that file to show.
await (async () => {
let file = await showOpenFilePicker()
if (!file) return "File not picked";
file = await file[0].getFile();
if (!file.type.startsWith('audio/')) return 'Invalid file: Not an audio file'
let audioData = await new AudioContext().decodeAudioData(await file.arrayBuffer());
let ctx = new OfflineAudioContext({
numberOfChannels: 1,
length: audioData.length,
@Vocaned
Vocaned / emptypng.py
Last active June 29, 2025 08:54
generate an empty png with 1x0 pixel dimension
import struct
import zlib
import base64
def chunk(t, data):
return (struct.pack('>I', len(data)) + t + data
+ struct.pack('>I', zlib.crc32(t + data)))
png = (b'\x89PNG\r\n\x1A\n'
+ chunk(b'IHDR', struct.pack('>IIBBBBB', 1, 0, 1, 0, 0, 0, 0)) # https://www.w3.org/TR/png/#11IHDR
@Vocaned
Vocaned / bf.py
Last active June 29, 2025 08:54
python brainfuck interpreter i wrote at 3:30AM because i couldn't sleep
program = input()
programpointer = 0
buffer = {}
pointer = 0
tmp = []
loops = {}
for i,c in enumerate(program):
if c == '[':
@Vocaned
Vocaned / gimmeavaccine.py
Last active June 29, 2025 08:54
Scrapes Flowmedik Oy EAika service for available vaccination times
import requests
import time
import bs4
CLIENTID = '' # First part of eaika domain. (https://[ID].eaika.fi)
GROUP = 'pfizer' # Partial string to search for in group name (usually vaccine name or age), searches all groups if empty
LOCATION = '' # Partial string to search for in vaccination location, searches all locations if empty
WEBHOOK_URL = '' # (discord style) Webhook url to return search results to, program returns json data if empty
def send_webhook(msg):
@Vocaned
Vocaned / opengraphparser.py
Last active June 29, 2025 08:54
Get OpenGraph tags from html using html.parser
import html.parser
class OpenGraphParser(html.parser.HTMLParser):
def __init__(self, *, convert_charrefs: bool = ...) -> None:
self.tags = {}
super().__init__(convert_charrefs=convert_charrefs)
def handle_starttag(self, tag, attrs):
if tag != 'meta':
return
@Vocaned
Vocaned / caption.sh
Last active June 29, 2025 08:54
meme captions using imagemagick
#!/bin/bash
in=$1
text=$2
out=$3
if [ $# -lt 3 ]; then
exit
fi
import znc
import requests
import re
class zncdiscord(znc.Module):
description = 'Discord webhooks for ZNC'
module_types = [znc.CModInfo.UserModule]
# Never send notifications from nicks in this list
nick_blacklist = ['',]
@Vocaned
Vocaned / pair-headphones.sh
Last active June 29, 2025 08:55
Automatically pair headphones using bluetoothctl
#!/bin/bash
prompt="#"
address="00:00:00:00:00:00" # mac address here
echo "=== Checking rfkill ..."
if [[ $(rfkill list bluetooth -o SOFT | tail -1) != "unblocked" ]]; then
echo "rfkill error. Unblock bluetooth with 'rfkill unblock bluetooth'"
rfkill list
exit 1