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 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") |
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
export class ActionService { | |
constructor(private actionReposiory: ActionReposiory) { | |
this.actionReposiory = actionReposiory; | |
} | |
async createAction(dto: any) { | |
return await this.actionReposiory.createAction(dto); | |
} | |
} |
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 dataclasses import dataclass | |
from alembic import op | |
@dataclass | |
class ForeignKeyConstraint: | |
name: str | |
table: str | |
column: str | |
sql: str |
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
""" | |
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 |
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
#!/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 |
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
version: "3.7" | |
services: | |
maildev: | |
image: maildev/maildev:1.1.1 | |
environment: | |
MAILDEV_INCOMING_USER: user | |
MAILDEV_INCOMING_PASS: pass | |
ports: |
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 aiohttp import web | |
import tartiflette | |
from tartiflette_aiohttp import register_graphql_handlers | |
import loader | |
sdl = """ | |
type Query { | |
books: [Book] | |
} |
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 aiohttp import web | |
from strawberry.http import process_result | |
import loader | |
import graph | |
routes = web.RouteTableDef() |
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 io | |
import os | |
EOF_REVERSED = b'%%EOF'[::-1] | |
def fix_PDF_EOF(content: io.BytesIO) -> io.BytesIO: | |
""" Truncate data from last %%EOF in given PDF """ |
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
const puppeteer = require('puppeteer'); | |
const express = require('express'); | |
const asyncHandler = require('express-async-handler'); | |
(async () => { | |
// initialise Express.js framework | |
const app = express(); | |
// start chromium browser | |
let browser = await puppeteer.launch({headless: true}); |
NewerOlder