Skip to content

Instantly share code, notes, and snippets.

View codewithleader's full-sized avatar
💭
I love programming 👨‍💻💙

Elis Antonio Perez codewithleader

💭
I love programming 👨‍💻💙
View GitHub Profile
@codewithleader
codewithleader / react-vite-testing-config.md
Last active October 3, 2022 20:23
Instalación y configuracion de Jest + React Testing Library: Guia para configurar las pruebas.

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:
@codewithleader
codewithleader / git-commands.md
Last active September 16, 2025 21:09
Git and GitHub. Todos los comandos con comentarios.

Curso de Git & GitHub & Gist

  • git --version: Verifica si git está instalado y muestra la versión.

  • git help OR git --help: Ayuda.

  • git help <commandName> Ex: git help commit OR git --help commit It's the same help or --help

Note: to go out: q

@codewithleader
codewithleader / MongoID-regexp.ts
Created October 3, 2022 20:22
MongoID-RegExp: Expresion regular para saber si es un ID valido de Mongo.
const checkMongoIDRegExp = new RegExp("^[0-9a-fA-F]{24}$");
@codewithleader
codewithleader / db.ts
Last active October 12, 2022 19:22
Next.js - Mongo + Mongoose connection
import mongoose from 'mongoose';
/**
* 0 = disconnected
* 1 = connected
* 2 = connecting
* 3 = disconnecting
*/
const mongoConnection = {
isConnected: 0,
@codewithleader
codewithleader / mongoOperators.md
Created October 21, 2022 17:40
MongoDB - Operadores y Guia de uso

Operadores en Mongo

Listado de operadores RELACIONALES

  • $eq: equal - igual
  • $lt: low than - menor que
  • $lte: low than equal - menor o igual que
  • $gt: greater than - mayor que
  • $gte: greater than equal - mayor o igual que
  • $ne: not equal - distinto
@codewithleader
codewithleader / NextJS-Conceptos.md
Last active October 26, 2022 20:44
Next JS - Conceptos. Guía.

Next JS - Conceptos

  • SSR: Server-side Rendering.

  • SSG: Static-site Generation.

@codewithleader
codewithleader / ResponsivelyApp.desktop
Last active November 27, 2022 04:18
ResponsivelyApp.desktop Acceso directo para la App. Guardar en: ~/.local/share/applications/ Agregar el Icon y Exec en la carpeta /home/elis/ResponsivelyApp/ y verificar el numero de la version
[Desktop Entry]
Type=Application
Terminal=false
Name=ResponsivelyApp
Icon=/home/elis/ResponsivelyApp/responsivelylogo.svg
Exec=/home/elis/ResponsivelyApp/ResponsivelyApp-0.19.1.AppImage
GenericName[es_ES]=Responsively App
@codewithleader
codewithleader / validations.ts
Last active June 25, 2024 21:46
Validar email
export const isValidEmail = (email: string): boolean => {
const match = String(email)
.toLowerCase()
.match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
);
return !!match;
};
@codewithleader
codewithleader / vite.config.js
Last active December 1, 2022 18:41
vite.config.js para GitHub Pages
import { defineConfig } from 'vite';
export default defineConfig({
base: '/route-name/',
});
@codewithleader
codewithleader / initial-template.css
Created December 5, 2022 01:46
Configuracion inicial de una hoja de estilos css
:root {
--fuenteHeading: 'PT Sans', sans-serif;
--fuenteParrafos: 'Open Sans', sans-serif;
--primario: #784d3c;
--blanco: #ffffff;
--negro: #000000;
}
html {