Skip to content

Instantly share code, notes, and snippets.


Valerii Duz valeriiduz

View GitHub Profile
valeriiduz /
Created Mar 10, 2022
Profilers for check how much time spend method or funtion
import cProfile
import datetime
import logging
from functools import wraps
from inspect import isclass
from django.conf import settings
logger = logging.getLogger(__name__)
valeriiduz /
Last active Mar 14, 2022
Django query debugger
from django.db import connection, reset_queries
import time
import functools
def query_debugger(func):
def inner_func(*args, **kwargs):
valeriiduz / Makefile
Last active Jul 8, 2022
Makefile for manipulate docker-compose of python Dockerfile
View Makefile
include .env
export $(shell sed 's/=.*//' .env)
.PHONY: help up start stop restart status ps clean
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
up: ## Up all or c=<name> containers in foreground
docker-compose -f $(or $(DOCKER_COMPOSE_FILE), docker-compose.yml) up $(c)