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 logging | |
from logging.handlers import HTTPHandler as HTTPLoggingHandler | |
from typing import Any | |
class ExternalFilter(logging.Filter): | |
flag = "to_external_source" | |
def filter(self, record: logging.LogRecord) -> bool: | |
return getattr(record, self.flag, False) |
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
# ruff: noqa: N802, N815, E501 | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): |
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
# Proxy echo TCP server program | |
import socket | |
HOST = "localhost" | |
PORT = 6667 | |
HOST_NEW = "localhost" | |
PORT_NEW = 6666 | |
CONNECTED = False |
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
command 2>&1 >/dev/null | grep "line" |
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
from __future__ import annotations | |
from typing import Callable, Union | |
class Pipe: | |
def __init__(self, callable_: Callable): | |
self.callable_ = callable_ | |
def __rshift__(self, then: Callable | Pipe) -> Pipe: |
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
from collections.abc import Iterable, Sequence | |
from typing import TypeVar, TypedDict | |
import xlsxwriter | |
from .items import Item | |
T = TypeVar("T") | |
class Data(TypedDict): |
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
pip freeze | sed 's/=.*//g' | xargs pip uninstall -y |
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
.git/info/exclude is a local .gitignore file. Same syntax as .gitignore |
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
alias black79="black --line-length 79 --force-exclude '((^.*(\/migrations\/).*\.py)|(.*\.(?!pyi?$)[^.]+$))' --extend-exclude migrations/" | |
alias isort79="isort --multi-line 3 --force-alphabetical-sort-within-sections --trailing-comma --combine-as --lines-after-imports 2 --filter-files --extend-skip migrations" | |
alias autoflake79="autoflake --remove-all-unused-imports --ignore-init-module-imports -r -v --in-place --exclude '*/migrations/*'" | |
git diff --quiet --cached --name-only --diff-filter=D | |
start_condition_0=$? | |
git diff --quiet --cached --name-only --diff-filter=ACMR | |
start_condition_1=$? | |
if [ $start_condition_0 = 0 ] && [ $start_condition_1 = 1 ] |
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
__pycache__ | |
.venv | |
.vscode | |
.mypy_cache | |
.pytest_cache | |
.dockerignore | |
*.ps1 | |
*.sh | |
*.log |
NewerOlder