Skip to content

Instantly share code, notes, and snippets.

View Miguel07Alm's full-sized avatar
🧑‍🍳

Miguel07Alm Miguel07Alm

🧑‍🍳
View GitHub Profile
@Miguel07Alm
Miguel07Alm / create_postman_collection_nestjs.py
Last active March 3, 2024 18:19
It creates automatically your postman collection based in NestJS endpoints
import json
# Absolute path of your file .ts where the endpoints are located (example: '/home/dev/project/app/driver/src/driver.controller.ts')
file_path = ''
postman_collection = {
"info": {
"name": "NestJS Endpoints Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": []
}
@Miguel07Alm
Miguel07Alm / actions.ts
Created March 4, 2024 22:07
Simple script for adding files to AWS S3 Bucket
"use server";
import { cookies } from "next/headers";
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import crypto from "crypto";
import verifyJwtToken from "@/utils/api/verifyJwtToken";
const generateFileName = (bytes = 32) =>
crypto.randomBytes(bytes).toString("hex");
@Miguel07Alm
Miguel07Alm / clasificador_imagenes.py
Last active May 30, 2024 20:14
Tutorial sobre el desarrollo de un modelo con Machine Learning (IA), el cual utiliza un modelo de clasificación de imagenes (convolutional model) para predecir si una imagen es x según los labels del dataset.
# Importar bibliotecas necesarias
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
import numpy as np
# Cargar y preprocesar los datos
(train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data()
train_images, test_images = train_images / 255.0, test_images / 255.0