Skip to content

Instantly share code, notes, and snippets.

View felipejoq's full-sized avatar
🙌
Hello!

Felipe felipejoq

🙌
Hello!
View GitHub Profile
@Klerith
Klerith / self-certificates.sh
Last active July 7, 2024 21:51
Generar certificados
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
@Klerith
Klerith / configurar-node-ts.md
Last active July 15, 2024 04:34
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
Note + TypeScript + Jest = Testing

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
@Klerith
Klerith / pasos-node-typescript.md
Last active July 16, 2024 02:23
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@Klerith
Klerith / medium-dbdiagram.txt
Created July 14, 2023 18:25
Creación del diagrama de la base de datos
Table users {
user_id integer [pk, increment]
username varchar [not null, unique]
email varchar [not null, unique]
password varchar [not null]
name varchar [not null]
role varchar [not null]
gender varchar(10) [not null]
@Klerith
Klerith / programas.md
Created July 13, 2023 20:10
Programas para hacer diagramas entidad relación
@Klerith
Klerith / password-property-dto.ts
Created July 16, 2022 16:32
Password validation - DTO
@IsString()
@MinLength(6)
@MaxLength(50)
@Matches(
/(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, {
message: 'The password must have a Uppercase, lowercase letter and a number'
})
password: string;
@Klerith
Klerith / templateSlice.js
Last active July 15, 2024 17:09
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@Klerith
Klerith / vite-testing-config.md
Last active July 16, 2024 15:46
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto: