Skip to content

Instantly share code, notes, and snippets.

View WitherOrNot's full-sized avatar
🤠
yeehaw

WitherOrNot

🤠
yeehaw
View GitHub Profile
@WitherOrNot
WitherOrNot / nusdecrypt.py
Last active May 14, 2023 20:11
Decrypt Wii U NUS downloads for Loadiine/emulator
#!/usr/bin/env python3
from struct import pack, unpack, calcsize
from Crypto.Cipher import AES
from Crypto.Hash import SHA1
from binascii import hexlify, unhexlify
from io import BytesIO
from os.path import join
from os import makedirs
import sys
@WitherOrNot
WitherOrNot / nusdl.py
Last active May 14, 2023 20:11
Download games from Wii U NUS
#!/usr/bin/env python3
import struct
import subprocess
import os
import base64
import shutil
import argparse
import binascii
import requests
@WitherOrNot
WitherOrNot / c2rdl.py
Last active May 10, 2023 20:38
office click-to-run (c2r) downloader
#!/usr/bin/env python3
from bs4 import BeautifulSoup
from requests import head, get
from os import remove
from subprocess import run
from argparse import ArgumentParser
from platform import architecture
from shutil import copy
@WitherOrNot
WitherOrNot / pixelcanvas.py
Created February 23, 2021 21:35
pixelcanvas bot
#!/usr/bin/env python3
import sys
import numpy as np
from time import sleep
from PIL import Image
from requests import session
colors = [
(255, 255, 255),
@WitherOrNot
WitherOrNot / virp.py
Created December 18, 2020 05:53
Implement VIRP table for any configuration of resistors in a circuit
from gmpy2 import mpfr
from rich.console import Console
from rich.table import Table
class Resistor:
def __init__(self, resistance):
self.resistance = mpfr(resistance)
class Circuit:
def __init__(self, *wires):
@WitherOrNot
WitherOrNot / boolean.lark
Last active August 30, 2020 17:43
Truth Table Generator
?start: arrow
?arrow: operator
| arrow "->" operator -> conditional
| arrow "<>" operator -> biconditional
?operator: atom
| operator "^" atom -> conjunction
| operator "v" atom -> disjunction
@WitherOrNot
WitherOrNot / img2desmos.py
Created June 26, 2020 03:57
Convert image to desmos graph
import numpy as np
import cv2
import matplotlib.pyplot as plt
import code
import time
import sys
from fractions import Fraction
SKIP = 8 if len(sys.argv) <= 3 else int(sys.argv[3])

Keybase proof

I hereby claim:

  • I am witherornot on github.
  • I am witherornot (https://keybase.io/witherornot) on keybase.
  • I have a public key whose fingerprint is 5378 364C 6FD6 1144 9D6E 7764 19F9 47B0 EFCC E2B6

To claim this, I am signing this object:

from PIL import Image, ImageChops
import sys
img = Image.open(sys.argv[1]).convert("RGB")
w, h = img.size
out = Image.new("RGB", (w, h))
def f(x, y):
return ((2*x+y) % w, (x+y) % h)
@WitherOrNot
WitherOrNot / tic_tac_toe.py
Last active February 10, 2020 12:48
Tic-Tac-Toe Python 2 Codegolf in 247 bytes
o=w=0;s=" ";b=[s]*9
while 1:
print"\n".join(["".join(b[x:x+3])for x in 0,3,6])
if w:break
h=~-input();z=b[h]==s;b[h]=[b[h],"XO"[o]][z];o=[o,2+~o][z]
for i in range(8):
e,f,g=map(int,`0x341a4a6fa990a9ee254e`[i*3:][:3]);w|=(b[e]==b[f]==b[g]!=s)