Skip to content

Instantly share code, notes, and snippets.

banner = r'''
. . . .
,`,`,`,`,
. . . . `\`\`\`\;
`\`\`\`\`, ~|;!;!;\!
~\;\;\;\|\ (--,!!!~`! .
(--,\\\===~\ (--,|||~`! ./
(--,\\\===~\ `,-,~,=,:. _,//
(--,\\\==~`\ ~-=~-.---|\;/J,
(--,\\\((```==. ~'`~/ a |
@KhanhhNe
KhanhhNe / .odoorc
Last active August 25, 2022 13:19
Docker compose, Odoo config file and install script (for VPS installation) for Odoo addons development purpose.
[options]
addons_path = /mnt/extra-addons
db_name = odoo15
admin_email = admin
admin_passwd = admin
dev = all
log_level = debug
@KhanhhNe
KhanhhNe / gmail_create_message.py
Created July 18, 2022 03:30
Create a message object to use with Gmail API so you don't have to find in countless Google searches.
import base64
import email.policy
from email.mime.text import MIMEText
def create_message(sender, to, subject, message_text):
"""
Create an email message.
:param sender: Sender's email (can use format '{name} <{email}>' to show custom sender name)
@KhanhhNe
KhanhhNe / rate_limit.py
Last active July 21, 2022 02:13
Python thread-safe throttling (rate limiting)
import asyncio
import threading
import time
from collections import deque
from datetime import datetime
from functools import wraps
from inspect import iscoroutinefunction
from typing import cast