Skip to content

Instantly share code, notes, and snippets.

View guibeira's full-sized avatar
🏠
Working from home

Guilherme de S. Vieira Beira guibeira

🏠
Working from home
View GitHub Profile
@guibeira
guibeira / docker-compose.yml
Created January 30, 2023 23:06
Media center
version: '3.8'
services:
pms-docker:
container_name: plex
network_mode: host
hostname: plex
# runtime: nvidia
environment:
- TZ=America/Sao_Paulo
- PLEX_UID=1000
@guibeira
guibeira / join_example.py
Created February 23, 2023 19:10
Simple solution for create batch and query nested objects
from uuid import uuid4
from collections import defaultdict
import uuid
from pydantic import BaseModel, Field
from pydantic.types import UUID4
from sqlalchemy import Column, MetaData, Table, create_engine, text, ForeignKey
from sqlalchemy.sql import select
from sqlalchemy.dialects import postgresql
DATABASE_NAME = "sqlalchemy_test"
@guibeira
guibeira / base_client.py
Created June 26, 2023 14:47
Sample of base client
import asyncio
import json
from functools import partial
from typing import Any, Dict, List, Optional, Type, TypeVar, Union
import httpx
from pydantic import BaseModel, Field
T = TypeVar("T", bound=BaseModel)
@guibeira
guibeira / output.json
Last active June 30, 2023 13:41
Example of how to load game_of_life payload
[
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0],
[1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0],