Skip to content

Instantly share code, notes, and snippets.

View Fuyukai's full-sized avatar
💭
-͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌

Lura Skye Fuyukai

💭
-͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌
View GitHub Profile
### Keybase proof
I hereby claim:
* I am SunDwarf on github.
* I am eyes (https://keybase.io/eyes) on keybase.
* I have a public key whose fingerprint is 8B8B 35B1 7125 4CB5 F7C4 5874 B33B 7868 C4AE 93CA
To claim this, I am signing this object:
# Modified from https://gist.github.com/cesarkawakami/887ba74c4bc99464feba
import dis
import struct
import types
# WHY.
def instancemethod(f):
if getattr(f, "im_func", None):
@Fuyukai
Fuyukai / pi-setup.sh
Created December 28, 2015 23:50
Setup a new Raspberry Pi server
#!/usr/bin/env bash
DRIVE=/dev/sdd
TAR_LOC=/home/eyes/Downloads/ArchLinuxARM-rpi-2-latest.tar.gz
echo "Enter IP of new Pi..."
read ip
echo "Unmounting existing partitions..."
umount -v ${DRIVE}1
"""
I'm so sorry.
"""
import inspect
import collections.abc as collections_abc
from collections import OrderedDict
def overloadable(func):
"""
"""
I'm so sorry.
"""
import inspect
import collections.abc as collections_abc
from collections import OrderedDict
def overloadable(func):
"""
"""
A uWSGI adapter for Kyoukai.
This allows you to run Kyoukai with uWSGI as the web server. It translates the WSGI protocol into Kyoukai itself.
"""
import asyncio
import greenlet
import functools
"""
A HTTP/2 interface to Kyoukai.
This uses https://python-hyper.org/projects/h2/en/stable/asyncio-example.html as a reference and a base. Massive thanks
to the authors of this page.
"""
import asyncio
import importlib
import ssl
import sys
@Fuyukai
Fuyukai / classes.py
Created April 22, 2017 21:31
Bootleg classes
import functools
def gi(s, k):
try:
return s[k]
except KeyError:
raise AttributeError(k) from None
@Fuyukai
Fuyukai / bootstrap-py.sh
Created September 28, 2017 18:38
Bootstraps my Python install.
#!/usr/bin/env bash
# Step 1: Add ~/.local/bin to PATH if it's not there already.
if ! [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then
export PATH=$HOME/.local/bin:$PATH
fi
# Step 2: Bootstrip pip into user directory using get-pip.py.
curl https://bootstrap.pypa.io/get-pip.py | python3 - --user
import sys
import asks
import curio
import traceback
from curious import Client
from curious.commands.manager import CommandsManager
from typing import Dict, Set
client = Client(token=sys.argv[1])