This file contains hidden or 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
| # This module introduces a Pydantic-first approach for handling Django model | |
| # references in API schemas, serving as a lightweight alternative to DRF | |
| # serializers and their OpenAPI integrations. Instead of relying on DRF’s | |
| # serialization layer, it defines a resolvable wrapper that represents Django | |
| # model instances by ID while keeping schema definitions fully Pydantic-based. | |
| # A dynamic OrmResolvable type generates model-specific proxies, and a recursive | |
| # resolver hydrates these proxies into actual Django instances after validation. | |
| # The ProjectBaseModel hooks this resolution step into Pydantic’s lifecycle, | |
| # enabling clean, declarative API schemas that remain tightly aligned with | |
| # Django models without DRF’s overhead. This is intended for projects wishing |
This file contains hidden or 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
| PYTHON_VERSION=3.11.9 | |
| pyenv install $PYTHON_VERSION | |
| pyenv shell $PYTHON_VERSION | |
| WHERE_IS_THE_PYTHON_UBUNTOVSKI=`pyenv which python` | |
| pipx reinstall --python=$WHERE_IS_THE_PYTHON_UBUNTOVSKI poetry | |
| pipx reinstall --python=$WHERE_IS_THE_PYTHON_UBUNTOVSKI cookiecutter |
This file contains hidden or 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/bash | |
| # | |
| # Update whole docker swarm stack from CI job and wait untill success. | |
| # Inits rollback process in case of unsuccessfull deployment. | |
| # | |
| # Requires another script from here: https://github.com/sudo-bmitch/docker-stack-wait | |
| # | |
| # By: Alexey Chudin <kazqvaizer@gmail.com> | |
| # License: MIT | |
| # |
This file contains hidden or 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/bash | |
| mplayer -ontop -noborder -geometry 300x300+80+750 -vf mirror,crop=240:240:30:0 -vo gl2 -msglevel all=0 -tv width=300:height=300:device=/dev/video0 tv:// & | |
| simplescreenrecorder --start-hidden &>/dev/null & | |
| sleep 3 | |
| wmctrl -r MPlayer -b add,sticky |
This file contains hidden or 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
| """ | |
| Here is a way to flatten python dictionaries for making multipart/form-data POST requests. | |
| {"some": ["balls", "toys"], "field": "value", "nested": {"objects": "here"}} | |
| -> | |
| {"some[0]": "balls", "some[1]": "toys", "field": "value", "nested[objects]": "here"} | |