Skip to content

Instantly share code, notes, and snippets.

View an0ndev's full-sized avatar
👨‍💻
writing a c++ programmable web server while procrastinating algebra homework

Eric Reed an0ndev

👨‍💻
writing a c++ programmable web server while procrastinating algebra homework
View GitHub Profile
@an0ndev
an0ndev / set_theory_reader.py
Created May 6, 2024 00:57
Set theory analysis tool for sheet music
import tkinter
import math
import functools
window = tkinter.Tk()
keys = ["c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "a#", "b"]
text_radius = 100
text_size = 16
@an0ndev
an0ndev / pro_nerdle_gen.py
Created March 22, 2022 05:46
Pro Nerdle Generator: unrestricted Pro Nerdle puzzle generator
# Pro Nerdle Generator: unrestricted Pro Nerdle puzzle generator
# Eric Reed (github.com/an0ndev) 2021
import tkinter, tkinter.messagebox
import requests
class ProNerdleGenerator:
def __init__ (self):
self.name = "Pro Nerdle Generator"
@an0ndev
an0ndev / app_audio_to_stream_and_output.pa
Created August 22, 2021 22:51
Selectively redirect application audio to VoIP apps along with default input while they play over default output
# ADD THE FOLLOWING LINES TO THE END OF /etc/pulse/default.pa to make them automatically run when pulse starts up (you will have to run 'pulseaudio -k' to restart pulse)
# to test without making it permanent, run each line from a terminal with "pacmd" in front, eg "pacmd load-module module-null-sink (etc)"
# combined_output: sink to accept audio from desired applications
load-module module-null-sink sink_name=combined_output sink_properties=device.description=combined_output
# send combined_output to real sink (eg speakers, headphones, etc)
load-module module-loopback source=combined_output.monitor sink=@DEFAULT_SINK@ latency_msec=1
# combined_input: sink to accept audio from combined_output and real source (eg mic)
load-module module-null-sink sink_name=combined_input sink_properties=device.description=combined_input
# send combined_output to combined_input
@an0ndev
an0ndev / yoink_token.py
Created June 13, 2021 00:46
pyCraft Microsoft account authentication
# yoink_token.py: pyCraft-compatible Microsoft account authentication
# use the following function:
# def get_mc_auth_token (*, force_use_new_msft_account: bool = False, force_regenerate_mc_client_token: bool = False) -> minecraft.authentication.AuthenticationToken:
# and DO NOT forget to fill in the constants below
# based on https://wiki.vg/Microsoft_Authentication_Scheme and https://wiki.vg/Authentication (for client token desc)
# YOU HAVE TO FILL THESE IN WITH AN AZURE APP
# follow https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app
client_id = "FILL_THIS_IN" # uuid
@an0ndev
an0ndev / dump_discord_token.py
Last active September 23, 2021 18:11
Discord token dumper
# dump discord token script by an0ndev 06/11/21, revised 08/23/21
# discord must be completely closed first! (check for tray icon)
import os, pathlib, sys, tkinter.messagebox # stdlib
try:
import leveldb # pip install leveldb
except ModuleNotFoundError:
os.system ("pip install leveldb")
import leveldb
@an0ndev
an0ndev / stream.py
Created June 7, 2021 11:32
stream.py: provides a stream of a macos primary display on a flask server at 0.0.0.0:5000 (warning: hardcoded path to ffmpeg, may need to change)
import flask
import subprocess
app = flask.Flask (__name__)
@app.route ("/")
def root ():
def gen ():
popen = subprocess.Popen ("~/Documents/ffmpeg/ffmpeg -f avfoundation -i 1 -c:v libx264 -preset ultrafast -tune zerolatency -f matroska -", shell = True, stdout = subprocess.PIPE)
# popen = subprocess.Popen ("ffmpeg/ffmpeg -f avfoundation -i 1 -c copy -f matroska -", shell = True, stdout = subprocess.PIPE)
@an0ndev
an0ndev / factor_thing.py
Created June 7, 2021 11:31
dumb factoring app i made for math class
factor_pairs = [(1, 100), (2, 50), (4, 25), (10, 10)]
min_pair = None
min_perimeter = None
for factor_one, factor_two in factor_pairs:
perimeter = ((factor_one * 2) + (factor_two * 2))
print ("checking", (factor_one, factor_two), perimeter)
if min_perimeter is None or perimeter < min_perimeter:
min_pair = (factor_one, factor_two)
min_perimeter = perimeter
@an0ndev
an0ndev / userbot_change_status.py
Last active April 2, 2021 00:25
Change the status of a userbot with discord.py
async def userbot_change_status (client, *, text, emoji = None):
"""|coro|
Changes a userbot's status.
Example
---------
.. code-block:: python3
client = discord.Client ("token", bot = False) # shh...
await userbot_change_status (client, text = "ToS is gone", emoji = "🥳")
Parameters
----------

Keybase proof

I hereby claim:

  • I am an0ndev on github.
  • I am an0ndev (https://keybase.io/an0ndev) on keybase.
  • I have a public key ASACq96B_jD61kRMJfT9Q6a61lhItuCGbgzPMjCfUh6ihwo

To claim this, I am signing this object:

@an0ndev
an0ndev / upload.py
Created November 1, 2020 00:43
Simple Flask-based file upload page
import flask, werkzeug.utils, os, os.path
UPLOADS_DIR = "uploads"
if not os.path.exists (UPLOADS_DIR): os.mkdir (UPLOADS_DIR)
app = flask.Flask (__name__)
@app.route ("/")
def root ():