Skip to content

Instantly share code, notes, and snippets.

View hyzyla's full-sized avatar

Yevhenii Hyzyla hyzyla

View GitHub Profile
@hyzyla
hyzyla / macos-copy-on-write-dir.sh
Created August 3, 2026 21:14
macos-copy-on-write-dir.sh
cow_clonedir() { python3 -c "import ctypes,ctypes.util,sys,os;l=ctypes.CDLL(ctypes.util.find_library('System'),use_errno=True);sys.exit(0 if l.clonefile(sys.argv[1].encode(),sys.argv[2].encode(),0)==0 else os.strerror(ctypes.get_errno()))" "$1" "$2"; }
@hyzyla
hyzyla / jiraffe_privacy_policy.md
Created July 19, 2026 20:29
Jiraffe Privacy Policy

Privacy Policy

Effective date: July 19, 2026

Thank you for using Jiraffe.

Your privacy is important. Jiraffe is designed to respect your privacy by collecting as little information as possible.

Information We Collect

@hyzyla
hyzyla / ukrposhta.py
Created January 3, 2024 16:52
Дістати поштові відділення по КАТОТТГ за допомогою API Укрпошти
from typing import List, Optional
import requests
from pydantic import BaseModel, Field
class GetPostOfficeEntry(BaseModel):
# Basic information
lock_en: str = Field(alias="LOCK_EN")
lock_ua: str = Field(alias="LOCK_UA")
@hyzyla
hyzyla / action.service.ts
Last active December 15, 2023 20:24
Controller + Service + Repository pattern with DrizzleORM
export class ActionService {
constructor(private actionReposiory: ActionReposiory) {
this.actionReposiory = actionReposiory;
}
async createAction(dto: any) {
return await this.actionReposiory.createAction(dto);
}
}
@hyzyla
hyzyla / upgrade.py
Created April 3, 2023 10:23
PostgreSQL change type of primary key using alembic
from dataclasses import dataclass
from alembic import op
@dataclass
class ForeignKeyConstraint:
name: str
table: str
column: str
sql: str
@hyzyla
hyzyla / error_reporting.py
Created December 30, 2022 10:03
Thin wrapper around Sentry SDK
"""
Thin wrapper around Sentry SDK, to hide details and do not depend on one product
"""
import logging
from contextlib import contextmanager
from typing import Any, Iterator
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
@hyzyla
hyzyla / get_unwrapped_messages.py
Created December 1, 2022 18:27
Script that allows to find unwrapped strings in Ukrainian langauge for translation
#!/usr/bin/env python3
# flake8: noqa
"""
Script that allows to find unwrapped strings in Ukrainian langauge for translation
"""
import ast
import re
import textwrap
from pathlib import Path
@hyzyla
hyzyla / docker-compose.yaml
Created July 19, 2022 17:06
maildev in docker-compose
version: "3.7"
services:
maildev:
image: maildev/maildev:1.1.1
environment:
MAILDEV_INCOMING_USER: user
MAILDEV_INCOMING_PASS: pass
ports:
@hyzyla
hyzyla / app.py
Last active September 29, 2020 12:50
aiohttp + tartiflette + aiodataloader ( DOESN'T WORKS!)
from aiohttp import web
import tartiflette
from tartiflette_aiohttp import register_graphql_handlers
import loader
sdl = """
type Query {
books: [Book]
}
@hyzyla
hyzyla / app.py
Created August 27, 2020 09:44
aiohttp + strawberry + aiodataloader example
from __future__ import annotations
from aiohttp import web
from strawberry.http import process_result
import loader
import graph
routes = web.RouteTableDef()