Skip to content

Instantly share code, notes, and snippets.

View carcigenicate's full-sized avatar

carcigenicate

View GitHub Profile
// ==UserScript==
// @name Seed Counter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Counts seeds
// @author carcigenicate
// @match https://www.zeldadungeon.net/breath-of-the-wild-interactive-map?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// ==/UserScript==
@carcigenicate
carcigenicate / changer.js
Created February 26, 2023 23:06
YouTube Subtitle Language Changer
// ==UserScript==
// @name Subtitle Language Changer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Spawns a small textbox and button to easily allow changing YouTube's subtitle language.
// @author You
// @match https://www.youtube.com/watch*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
from unittest import TestCase
from my_dataclass import MyDataclass
class BasicTestCaseBase(TestCase):
def setUp(self):
class TestClass(MyDataclass):
a: int
b: int
using namespace System.Net.Sockets
$Encoder = [System.Text.Encoding]::UTF8
$SIZE_BUFFER_SIZE = 4
$PROMPT = ">>> "
function Read-NBytes {
Param($Stream, $NToRead)
using namespace System.Net.Sockets
$Encoder = [System.Text.Encoding]::UTF8
$REMOTE_HOST = "127.0.0.1"
$REMOTE_PORT = 1234
$N_CONNECT_RETIRES = 5
$SIZE_BUFFER_SIZE = 4
class BadIterable:
def __iter__(self):
class Iterator:
def __init__(self):
self.n = 0
def __next__(self):
return self.n
def __iter__(self):
return self
def advance(self, by):
import subprocess as sp


class InterfaceController:
    def __init__(self, interface_name):
        self.name = interface_name

    def _checked_iwconfig(self, *commands) -> None:
        completed = sp.run(["iwconfig", self.name, *commands], capture_output=True)

if completed.returncode != 0:

from __future__ import annotations
import subprocess as sp
from multiprocessing import Process
COMMAND = "mpg123 -R"
# Commands are only characters in the ASCII set.
STDIN_ENCODING = "ascii"
END_PLAYBACK_SENTINEL = b"@P 0"
@carcigenicate
carcigenicate / NASM_push_emitter.py
Created January 31, 2021 01:50
A small script that emits NASM code that pushes a string to the stack and prints it via a system call.
def little_encode(text: bytes, word_size: int) -> list[int]:
return [int.from_bytes(text[i:i+word_size], "little")
for i in range(0, len(text), word_size)]
def emit_pushes(text: bytes, word_size: int, pushed_register: str) -> str:
chunks = little_encode(text, word_size)
return "\n".join(f"mov {pushed_register}, {chunk:#{word_size}x}\npush {pushed_register}"
for chunk in reversed(chunks))
def emit_write(text: bytes, word_size: int) -> str:
def meta_data():
maxSize = 2**10
if not os.path.exists('sample.data'):
with open('sample.data', 'wb+') as ssd:
data = {
0: [],
1: {'.': None,}
}
data[1]['~'] = data[1]