Skip to content

Instantly share code, notes, and snippets.

View JonathanLoscalzo's full-sized avatar

Jonathan Loscalzo JonathanLoscalzo

View GitHub Profile
@JonathanLoscalzo
JonathanLoscalzo / dto.spec.ts
Last active May 21, 2025 04:09
Validation issues using special mapped-types
import {
IntersectionType,
OmitType,
PartialType,
PickType,
} from '@nestjs/mapped-types';
import { IsNotEmpty, IsString, Length, validate } from 'class-validator';
export class Base {
@IsString()
@JonathanLoscalzo
JonathanLoscalzo / pipes_and_filter.py
Created January 28, 2025 16:16
pipes & filter example
import time
from functools import wraps
# 1. Definición de los interceptores
def interceptor_de_cache(cache):
"""Interceptor que verifica si el resultado ya está en cache."""
def wrapper(datos):
import './App.css';
import React, { useState, useEffect } from 'react';
// Implement an interface for drawing 2D bounding boxes on top of an image.
// Requirements:
// * The user should be able to click-and-drag on the image to draw a box.
// * Boxes should remain on the image after they are drawn.
// * Boxes should be able to overlap each other.
@JonathanLoscalzo
JonathanLoscalzo / docker-compose.yml
Created August 28, 2024 01:28
Postgres + PGAdmin
version: '3.9'
services:
db:
container_name: tabi_postgres
platform: linux/amd64/v8
image: postgres
restart: unless-stopped
shm_size: 128mb
volumes:
@JonathanLoscalzo
JonathanLoscalzo / suggested-folder.txt
Created August 25, 2024 19:48
suggested folder structure for fastapi+alembic project
fastapi-project
├── alembic/
├── src
│ ├── auth
│ │ ├── router.py # auth main router with all the endpoints
│ │ ├── schemas.py # pydantic models
│ │ ├── models.py # database models
│ │ ├── dependencies.py # router dependencies
│ │ ├── config.py # local configs
│ │ ├── constants.py # module-specific constants
@JonathanLoscalzo
JonathanLoscalzo / main.rs
Created August 22, 2024 22:26
rust - random things
// // strings3.rs
// //
// // Execute `rustlings hint strings3` or use the `hint` watch subcommand for a
// // hint.
// // I AM NOT DONE
// fn trim_me(input: &str) -> String {
// // TODO: Remove whitespace from both ends of a string!
// input.trim().to_string()
@JonathanLoscalzo
JonathanLoscalzo / .envrc
Created August 21, 2024 02:14
HOW TO RUN DOCKER IMAGES IN MAC M2 - For future generations
export DOCKER_DEFAULT_PLATFORM=linux/x86_64/v8
@JonathanLoscalzo
JonathanLoscalzo / llm-zoomcamp-homework-4-monitoring-2024.ipynb
Created August 19, 2024 00:50
LLM Zoomcamp - Homework 4 - Monitoring (2024).ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JonathanLoscalzo
JonathanLoscalzo / llm_zoomcamp_rag-homework.ipynb
Created July 16, 2024 20:14
LLM_zoomcamp_RAG - Homework.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.