Skip to content

Instantly share code, notes, and snippets.

@rshmhrj
rshmhrj / .mlc
Last active July 22, 2024 17:05
Make LeetCode (MLC): Quickly Scaffold LeetCode Problems for Python https://rshmhrj.io/posts/2024/mlc/
code_folder=./lc
study_plan=150
test_folder=./tests
test_file_name=test_lc.py
filename_prefix=p
filename_extension=py
difficulty_name_easy=1_easy
difficulty_name_medium=2_medium
difficulty_name_hard=3_hard
@rshmhrj
rshmhrj / database.py
Created January 19, 2024 04:56
Sample db models using sqlalchemy, demonstrating automatic password hashing
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
import logging
log = logging.getLogger(__name__)
"""ref: https://fastapi.tiangolo.com/tutorial/sql-databases/"""
SQLALCHEMY_DATABASE_URL = "postgresql://admin:admin@localhost:5432/test_gql"