Skip to content

Instantly share code, notes, and snippets.

View mpgxc's full-sized avatar
☢️
always learning...

mpgxc mpgxc

☢️
always learning...
  • Software Engineer
  • Oeiras, Piauí, Brasil.
  • 13:20 (UTC -03:00)
View GitHub Profile
@mpgxc
mpgxc / serverless_s3_glacier.yml
Last active September 30, 2024 18:17
Provisionar Bucket S3 Standard com regra de LifeCycle com S3 Glacier
service: backup-reports
provider:
  name: aws
  runtime: nodejs20.x
  region: us-east-1
  stage: ${opt:stage, 'dev'}
  iam:
    role:
      statements:
@mpgxc
mpgxc / result_monad.py
Created April 28, 2024 20:33
A super simples result monad approach
from typing import Generic, TypeVar, Union, Optional
T = TypeVar("T")
E = TypeVar("E")
class _Ok(Generic[T]):
def __init__(self, value: Optional[T] = None) -> None:
self.value = value
self.is_ok = True
@mpgxc
mpgxc / media_file_groupby.py
Created April 28, 2024 17:05
Gerencia o processo de mover arquivos de uma pasta de origem para uma pasta de destino, organizando-os em subpastas baseadas no ano de criação e tipo de arquivo (fotos ou vídeos).
import os
import shutil
from datetime import datetime
from PIL import Image
from tqdm import tqdm
class FileManager:
"""
Gerencia o processo de mover arquivos de uma pasta de origem para uma pasta de destino,
@mpgxc
mpgxc / settings.json
Created April 23, 2024 13:12
vscode-settings.json
{
"editor.tabSize": 2,
"editor.fontWeight": "500",
"editor.fontFamily": "JetBrains Mono",
"editor.renderWhitespace": "none",
"editor.accessibilitySupport": "off",
"editor.fontLigatures": true,
"editor.inlineSuggest.enabled": true,
"editor.semanticHighlighting.enabled": true,
"editor.screenReaderAnnounceInlineSuggestion": true,