Skip to content

Instantly share code, notes, and snippets.

View aalekhpatel07's full-sized avatar
๐Ÿ˜‡
grateful

Aalekh Patel aalekhpatel07

๐Ÿ˜‡
grateful
View GitHub Profile
@aalekhpatel07
aalekhpatel07 / deadlock_thread.py
Created September 24, 2025 00:55
An example of a Python thread that exits uncleanly while holding a shared lock, effectively poisoning it and blocking the main thread forever from progressing.
#!/usr/bin/env python
import threading
import time
from datetime import datetime
import sys
LOCK = threading.Lock()
_print_og = print
We can't make this file beautiful and searchable because it's too large.
"","title","id","description","release_date","lang"
"1","Statistics Canada - Data Visualization Products","71-607-X","This table contains 661 series, with data starting from 1981 (not all combinations necessarily have data for all years). This table contains data described by the following dimensions (Not all combinations are available): Geography (19 items: Canada, provinces and international; Newfoundland and Labrador; Prince Edward Island; Nova Scotia; ...) ; Assets and liabilities (36 items: Bank notes and coin other than gold and silver bullion; Securities issued or guaranteed by a Canadian province; Securities issued or guaranteed by a Canadian municipal or school corporation; Other securities; ...).",2023-12-11,"eng"
"2","Chartered bank aggregates, home equity lines of credit, quarter end, Bank of Canada","10-10-0135-01","Quarter-end data on the home equity lines of credit (HELOC) chartered bank for residential secured lending with properties in Canada (excluding business loans).",2023-12-11,"eng"
@aalekhpatel07
aalekhpatel07 / tasks.py
Created June 9, 2022 14:32
An invoke task to generate documentation, package, and publish a custom Python module.
#!/usr/bin/python
from invoke import task
import re
from pathlib import Path
def get_app_name(prompt=False):
if prompt:
return input("Enter the name of the app:")
with open("setup.py", "r") as f: