Allows you to import Python modules from the top level of a GitHub repository. Basically, golang's import semantics but in Python fashion.
>>> import githubimport
>>> from MineRobber9000.test_modules import blah
>>> blah.foo()
"bar"
########################################################### | |
# How to NEVER use lambdas. An inneficient and yet educa- # | |
# tonal [sic] guide to the proper misuse of the lambda # | |
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] # | |
# original by (and apologies to): e000 (13/6/11) # | |
# now in Python 3 courtesy of: khuxkm (17/9/20) # | |
########################################################### | |
## Part 1. Basic LAMBDA Introduction ## | |
# If you're reading this, you've probably already read e000's |
#!/usr/bin/liquidsoap | |
set("log.file", false) | |
# Allow a UNIX domain socket server. (You can make a telnet server, but the UNIX domain socket is easier for me to grok.) | |
set("server.socket",true) | |
set("server.socket.path","/home/khuxkm/RadioMineRobber/socket") | |
# This is your input source. In this example, it's just the tracks from `tracks.pls`, but it could be soundcard input or line-in | |
pl = mksafe(playlist("tracks.pls")) |
A transport adapter to make gopher requests from python-requests. Here be dragons.
I've documented most of this shit with my comments, but I seriously warn you, for your own sanity: don't do this. Don't use this, don't try and write your own transport adapter, there's just so much weird crap you have to deal with. Just take a look, maybe test it once or twice, say "neat", and walk away.
#!/usr/bin/python3 | |
import cgi, wikipedia, os, sys, traceback, wikipedia.exceptions | |
from urllib import parse | |
wikipedia.USER_AGENT = "uwupedia (https://gist.github.com/MineRobber9000/803840e86f386d438608eb85920b6a6a)" | |
# inline uwu | |
SUBSTITUTES = dict( | |
l="w", | |
r="w", | |
L="W", |
#!/usr/bin/env python | |
import os, os.path, stat, sys, base64 | |
# TOTP lib inlined | |
import time, hmac, base64, hashlib, struct | |
def pack_counter(t): | |
return struct.pack(">Q", t) |
A brainfuck of a Brainfuck interpreter. Written at 2 in the morning, because
who needs sleep? (Answer: me. I didn't even really I named the main class
BFInterpeter
until it caused an error.)
So the AST mumbo-jumbo creates a class, BFInterpreter
, that has one method: a
@classmethod
'd method called interpret
. This implements the core tenets of