Skip to content

Instantly share code, notes, and snippets.

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

mpgxc mpgxc

☢️
always learning...
View GitHub Profile
@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,
@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 / 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