Skip to content

Instantly share code, notes, and snippets.

View johnslavik's full-sized avatar

Bartosz Sławecki johnslavik

View GitHub Profile
@johnslavik
johnslavik / emailing.py
Last active November 11, 2022 20:21
Minimal, persistent and multi-threaded e-mail delivery system in Flask
"""
Remember to set the SMTP_HOST environment variable
or pass it as a keyword argument to EmailWorker()!
Requirements:
pip install flask-mail persist-queue
Usage:
# To deliver an e-mail
from flask_mail import Message
import functools
from reprlib import recursive_repr
from typing import Iterable
class TreeOverflow(OverflowError, ValueError):
pass
def _solve_args(**kwds):
@johnslavik
johnslavik / encoding.py
Created August 11, 2021 11:04
non-ASCII ASCII
b'\xbfa\xbf\xf3\xb3\xe6 g\xea\x9cl\xb9 ja\x9f\xf1' # -> żażółć gęślą jaźń
# TODO: figure out what the heck is the encoding