Skip to content

Instantly share code, notes, and snippets.

View pedrovasconcellos's full-sized avatar

Pedro Vasconcellos pedrovasconcellos

View GitHub Profile
@pedrovasconcellos
pedrovasconcellos / GITHUB_COPILOT_CODE_REVIEW_TRAINING.md
Last active November 19, 2025 21:30
Treinamento do Github Copilot Code Review

Regras TÉCNICAS de análise para Code Review (aplique estritamente ao revisar um PR — Pull Request)

  1. Complexidade ciclomática

    • Marque BLOQUEANTE se > 9.
    • Exigir quebra em funções menores OU early return para reduzir ramos.
  2. Nomes de variáveis

  • Devem expressar intenção. ❌ Abreviações opacas (ex.: tmp, res, arr1).
@pedrovasconcellos
pedrovasconcellos / WHAT_IS_A_MEMORY_BANK.md
Created November 3, 2025 04:47
What is a Memory Bank?

What Is the Memory Bank For?

They are checklists that serve as verification guides to ensure that changes carried out by artificial intelligence (AI) in the code respect the defined standards and workflows of the project, reducing errors and maintaining consistency.

1. Before implementing

Purpose

@pedrovasconcellos
pedrovasconcellos / EXAMPLE_TYPESCRIPT_CLEAN_ARCHITECTURE.md
Created November 1, 2025 09:35
Example of clean architecture using TypeScript.

Layer Mapping

1. domain/internal/domain (Go)

Innermost layer — pure business rules.

// domain/entities/Order.ts
export class Order {
  private id: string;
  private customerId: string;
@pedrovasconcellos
pedrovasconcellos / WHAT_IS_A_MEMORY_BANK_PTBR.md
Last active November 3, 2025 04:44
O que é um Memory Bank?

Para que serve o Memory Bank?

São checklists que servem como guias de verificação para garantir que alterações realizadas pela inteligência artificial (IA) no código respeitem os padrões definidos e workflows do projeto, reduzindo erros e mantendo a consistência.

1. Antes de implementar

Propósito

@pedrovasconcellos
pedrovasconcellos / CLEAN_ARCHITECTURE.md
Last active November 7, 2025 02:00
Clean Architecture Memory Bank

Clean Architecture Memory Bank

TL;DR

  • Clean Architecture keeps business rules independent from delivery so changes in frameworks never break core logic.
  • Dependencies flow inward: infrastructure → adapters → application → domain.
  • Use cases expose ports; adapters implement them; infrastructure wire everything together under cmd/ entrypoints.

Core Principles

  • Separation of concerns: Domain logic lives in entities/value objects; use cases orchestrate; adapters translate boundaries; infrastructure provide tooling (frameworks and drivers) only.
  • Dependency rule: Inner layers know nothing about outer layers—never import adapters or infrastructure from the domain or application packages.
@pedrovasconcellos
pedrovasconcellos / CLEAN_ARCHITECTURE_FOLDER_STRUCTURE.md
Last active November 7, 2025 02:09
Clean Architecture folder structure

Clean Architecture

Folder structure

.                                     # Repository root
├── .github/                          # CI/CD workflows configurations
│   └── workflows/
│       ├── ci.yml                    # Test and lint pipeline
│       └── cd.yml                    # Deploy pipeline
@pedrovasconcellos
pedrovasconcellos / insert_random_data.py
Created April 11, 2025 00:01
Insert random data into MongoDB
from pymongo import MongoClient
from datetime import datetime
import uuid
from urllib.parse import quote_plus
USER = "master"
PASSWORD = quote_plus("password") # encodes the password
HOST = "localhost"
AUTH_DB = "admin"
DATABASE = "database_name"
from pymongo import MongoClient
import json
from datetime import datetime
from urllib.parse import quote_plus
USER = "master"
PASSWORD = quote_plus("password") # encodes the password
PASSWORD_PROD = quote_plus("password_prod")
HOST = "localhost"
HOST_PROD = "cluster.com"
@pedrovasconcellos
pedrovasconcellos / 20-intel.conf
Last active February 13, 2025 15:49
Virtual Monitor Xorg
#sudo vim /etc/X11/xorg.conf.d/20-intel.conf
#FileContent
Section "Device"
Identifier "IntelGPU"
Driver "intel"
Option "AccelMethod" "sna"
# Option "TearFree" "true"
EndSection
@pedrovasconcellos
pedrovasconcellos / universal-us-keyboard.sh
Last active February 7, 2025 01:56
Universal Keyboard English US
vim ~/.XCompose
include "%L"
<dead_acute> <c> : "ç" U+00E7
<dead_acute> <C> : "Ç" U+00C7
#Log out afterwards so that the system complies with the instruction