Skip to content

Instantly share code, notes, and snippets.

View KhanhhNe's full-sized avatar

KhanhhNe KhanhhNe

View GitHub Profile
@KhanhhNe
KhanhhNe / settings.json
Created October 23, 2025 07:26
VSCode user settings
{
"workbench.startupEditor": "none",
"editor.smoothScrolling": true,
"editor.mouseWheelScrollSensitivity": 0.3,
"security.promptForLocalFileProtocolHandling": false,
"github.copilot.enable": {
"*": true,
"plaintext": true,
"markdown": true,
"scminput": false
syntax on
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
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