Skip to content

Instantly share code, notes, and snippets.

View victorusachev's full-sized avatar

Виктор Усачёв victorusachev

View GitHub Profile
@churnikov
churnikov / loguru_vs_logging.md
Last active April 11, 2022 14:31
Loguru vs logging

Почему я думаю, что Loguru лучше Logging

Как говорится на главной странице Было ли вам когда-то лениво конфигурировать логгер и потому вы использовали print? У меня было так не раз. И используя loguru у вас нет причин не начинать сразу логировать.

В какой-то степени ниже будет пересказ README loguru, так что мб есть смысл почитать его. Но тут я добавляю немного сравнения со стандартными логгингом, пытаясь повторить в нем то, что умеет loguru.

TL;DR

Мне кажется, что коротко преимущества loguru описывает их оглавление:

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 06:43
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@h4
h4 / env.py
Last active June 20, 2024 13:00
Setup alembic to work properly with PostgreSQL schemas
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from models import Base
config = context.config
fileConfig(config.config_file_name)
@zmts
zmts / tokens.md
Last active July 22, 2024 18:25
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@kingkool68
kingkool68 / changelog.sh
Last active September 17, 2023 21:08
Bash script to generate a markdown change log of GitHub pull requests between tagged releases
#!/bin/bash
# Generate a Markdown change log of pull requests from commits between two tags
# Author: Russell Heimlich
# URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a
# HOW TO USE
# Copy this script to a directory under Git version control
# Make the script executable i.e. chmod +x changelog.sh
# Run it! ./changelog.sh
# Check CHANGELOG.md to see your results
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mixxorz
mixxorz / graphene.py
Last active May 29, 2024 14:53
Get requested fields from ResolveInfo. Graphene python.
"""
MIT License
Copyright (c) 2018 Mitchel Cabuloy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@JordanReiter
JordanReiter / crontab
Last active July 11, 2023 10:39
Remind yourself of what you did over the past day and week by reading a summary of all of your git commits.
0 22 * * 1,2,3,4,5 /path/to/git_changes.sh /path/to/projects/ # Sends 5 PM EST if server time is UTC
0 21 * * 5 /path/to/git_changes.sh -w /path/to/projects # Sends Friday @ 4PM EST if server time is UTC
@ratijas
ratijas / 1-Webhooks_pyTelegramBotAPI.md
Last active June 14, 2022 15:35
Examples of webhook using pyTelegramBotAPI (BaseHTTPServer, Flask and CherryPy).

Webhook examples using pyTelegramBotAPI

There are 3 examples in this directory using different libraries:

  • Python (CPython): webhook_cpython_echo_bot.py
    • Pros:
      • Official python libraries, it works out of the box (doesn't require to install anything).
      • Works with Python 2 and Python 3 (need to be converted with 2to3).
  • Cons: