Skip to content

Instantly share code, notes, and snippets.

@Lonami
Lonami / launchasync.py
Last active January 3, 2024 12:47
Wrapper to launch async tasks from threaded code
import threading
import asyncio
from queue import Queue as BlockingQueue
class TwoSidedQueue:
"""
Behaves like an `asyncio.Queue`, but `get` and `put` act on different ends.
"""
def __init__(self, queue_in, queue_out):
@Lonami
Lonami / mc-ping.py
Last active January 1, 2024 10:35
Python Minecraft Server Pinger
import struct
import socket
import base64
import json
import sys
class Server:
def __init__(self, data):
self.description = data.get('description')
@Lonami
Lonami / keybase.md
Created June 15, 2019 17:52
Keybase proof

Keybase proof

I hereby claim:

  • I am lonami on github.
  • I am lonami (https://keybase.io/lonami) on keybase.
  • I have a public key ASCoYKcU4x-Wl1k9AbYqLywxX2OUiE5XxHIfGn7Z17QheAo

To claim this, I am signing this object: