Skip to content

Instantly share code, notes, and snippets.

@ricardocuellar
ricardocuellar / section-09-types.go
Created February 23, 2026 17:45
This is the types.go of section 09 - Curso Golang
package main
import (
"fmt"
"regexp"
"strings"
)
type Email string
@ricardocuellar
ricardocuellar / instalaciones-recomendadas-golang.md
Last active January 15, 2026 16:20
Instalaciones recomendadas - Curso de Golang: Fundamentos del Lenguaje

Instalaciones recomendadas - Curso de Golang: Fundamentos del Lenguaje

Go Logo

Instalar Go

  1. Instalar Golang
  2. Verificar instalación de Golang
    • go version

Instalaciones recomendadas

@ricardocuellar
ricardocuellar / n8n_python_section6_urgent_medium_words.py
Created December 16, 2025 18:53
n8n - Python - section 6 - urgent - medium words
urgent_words = ["urgente", "asap", "hoy", "inmediato",
"último aviso", "venc", "vencimiento"]
medium_words = ["mañana", "esta semana", "pendiente", "recordatorio"]
@ricardocuellar
ricardocuellar / n8n_python_section6_triggers.py
Created December 16, 2025 18:51
n8n - Python - section 6 - triggers
triggers = [
"por favor", "favor", "responde", "responder", "confirmar", "confirma",
"envía", "enviar", "adjunta", "adjuntar", "pagar", "pago",
"revisar", "revisa", "agendar", "agenda", "asistir", "asiste",
"firma", "firmar", "aprobar", "aprueba"
]
@ricardocuellar
ricardocuellar / analyze_words.py
Created December 9, 2025 22:45
Python + n8n - Section 4 - Analyze words (black list)
SPANISH_STOPWORDS = {
"de", "la", "que", "el", "en", "y", "a", "los", "del", "se", "las",
"por", "un", "para", "con", "no", "una", "su", "al", "lo", "como",
"más", "mas", "o", "pero", "sus", "le", "ya", "si", "porque", "cuando",
"muy", "sin", "sobre", "también", "tambien", "me", "hasta", "hay",
"donde", "han", "quien", "entre", "está", "esta", "ser", "son",
}
def tokenize(text: str) -> List[str]:
@ricardocuellar
ricardocuellar / app.jsx
Last active November 3, 2025 17:06
Sección 15 - CorsDemo - App.jsx
import { useState } from "react";
function App() {
const [data, setData] = useState(null);
const [error, setError] = useState(null);
const fetchData = async () => {
setData(null);
setError(null);
@ricardocuellar
ricardocuellar / seeds_data.py
Created October 21, 2025 09:29
FastAPI - Sección 14 - Seeds - Categories, tags y users
CATEGORIES = [
{"name": "Python", "slug": "python"},
{"name": "FastAPI", "slug": "fastapi"},
{"name": "SQLAlchemy", "slug": "sqlalchemy"},
{"name": "Django", "slug": "django"},
{"name": "Flask", "slug": "flask"},
{"name": "Javascript", "slug": "javascript"},
{"name": "Golang", "slug": "golang"},
{"name": "Laravel", "slug": "laravel"},
]
@ricardocuellar
ricardocuellar / category_router.py
Created October 21, 2025 03:20
FastAPI - Sección 13 - Category - Router
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from app.api.v1.categories.repository import CategoryRepository
from app.core.db import get_db
from app.api.v1.categories.schemas import CategoryCreate, CategoryUpdate, CategoryPublic
router = APIRouter(prefix="/categories", tags=["categories"])
@router.get("", response_model=list[CategoryPublic])
@ricardocuellar
ricardocuellar / category_repository.py
Last active November 6, 2025 19:29
FastAPI - Sección 13 - Category - Repository
from __future__ import annotations
from typing import Iterable, Sequence
from collections.abc import Iterable as IterableABC
from sqlalchemy import select, func
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Session
from app.models.category import CategoryORM
class _ChunkCounter:
def __init__(self, f):
self._f = f
self.calls = 0
self.sizes = []
def read(self, n=-1):
data = self._f.read(n)
if data:
self.calls += 1
self.sizes.append(len(data))