WITH foreign_keys
AS (SELECT conname,
conrelid,
confrelid,
Unnest(conkey) AS CONKEY,
Unnest(confkey) AS CONFKEY
FROM pg_constraint
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import httpx | |
MAX_CONSUMERS = 50 | |
async def make_request(url): | |
async with httpx.AsyncClient(http2=True) as client: | |
response = await client.get(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import functools | |
import another | |
def tag(*name): | |
def outer(func): | |
func.tag = name | |
@functools.wraps(func) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import toml | |
import subprocess | |
import sys | |
class UpdateDeps: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Classes and metaclasses for easier ``__slots__`` handling. """ | |
from itertools import tee | |
import dis | |
__version__ = "2021.1.6" | |
__all__ = ("Slots",) | |
def self_assignemts(method) -> set: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple FIFO queue with Redis to run tasks asynchronously. | |
=========== | |
Description | |
=========== | |
This script implements a rudimentary FIFO task queue using Redis's list data | |
structure. I took a peek under Celery and RQ's source code to understand how | |
they've implemented the async task queue — harnessing the features of Redis and | |
Python's multiprocessing paradigm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Custom logger with colorized output. | |
MODULE_NAME: LINE_NUMBER: LOG_LEVEL: LOG_MESSAGE | |
Usage | |
====== | |
from common.logger import logger | |
logger.debug(f"{__name__}: This is a debug message.") | |
logger.info(f"{__name__}: This is an info message.") |