Skip to content

Instantly share code, notes, and snippets.

View angelcgar's full-sized avatar
馃幆
Focusing

Angel Contreras Garcia angelcgar

馃幆
Focusing
View GitHub Profile

Intala las dependencias necesarias

pnpm add -D vitest jsdom

alternativa a jsdom es happy-dom

instala Testing library

@angelcgar
angelcgar / vite-testing-config.md
Created December 20, 2024 15:21 — forked from Klerith/vite-testing-config.md
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:
@angelcgar
angelcgar / configurar-node-ts.md
Created December 20, 2024 13:23 — forked from Klerith/configurar-node-ts.md
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
@angelcgar
angelcgar / pasos-node-ts-jest.md
Created December 20, 2024 13:20 — forked from Klerith/pasos-node-ts-jest.md
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
// ==UserScript==
// @name Ocultar scrollbar
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Inyectar CSS para ocultar scrollbars
// @author Angel
// @match https://www.udemy.com/*
// @grant none
// ==/UserScript==
@angelcgar
angelcgar / git-alias.md
Last active December 9, 2024 00:18 — forked from Klerith/git-alias.md
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s "status --short"

Alternativa 煤til de status

git config --global alias.s "status -sb"

// ==UserScript==
// @name Udemy Video Pause with K
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Control Udemy videos with the K key instead of space.
// @author 脕ngel
// @match https://www.udemy.com/*
// @grant none
// ==/UserScript==
@angelcgar
angelcgar / time-since.ts
Created October 31, 2024 20:02 — forked from Klerith/time-since.ts
Fecha de creaci贸n humana
export const timeSince = ( date: string ) => {
const baseDate = new Date(date)
const seconds = Math.floor(( new Date().getTime() - baseDate.getTime() ) / 1000);
let interval = seconds / 31536000;