Skip to content

Instantly share code, notes, and snippets.

@Lonami
Lonami / launchasync.py
Last active August 27, 2024 14:41
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 / 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:

@Lonami
Lonami / mc-ping.py
Last active June 24, 2024 17: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')