Skip to content

Instantly share code, notes, and snippets.

View AngelCruzL's full-sized avatar
馃幆
Focusing

脕ngel Cruz AngelCruzL

馃幆
Focusing
View GitHub Profile
@Klerith
Klerith / README.md
Created March 6, 2024 16:41
Pasos para configurar y crear sub-m贸dulos en Git y Github

Pasos para crear los Git Submodules

  1. Crear un nuevo repositorio en GitHub
  2. Clonar el repositorio en la m谩quina local
  3. A帽adir el submodule, donde repository_url es la url del repositorio y directory_name es el nombre de la carpeta donde quieres que se guarde el sub-m贸dulo (no debe de existir en el proyecto)
git submodule add <repository_url> <directory_name>
  1. A帽adir los cambios al repositorio (git add, git commit, git push)
@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 / Dockerfile
Last active December 15, 2024 02:33
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
@Klerith
Klerith / Dockerfile
Last active May 28, 2025 22:00
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Build the app with cache dependencies
FROM node:18-alpine3.15 AS builder
@Klerith
Klerith / vite-testing-config.md
Last active May 29, 2025 19:07
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:
@Klerith
Klerith / parse-jwt.js
Created March 15, 2018 15:07
Parse - JWT - Obtener Payload y fecha de creaci贸n y expiraci贸n
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
@HashNuke
HashNuke / gist:608259
Created October 3, 2010 04:13
to undo push and commits
# to undo a git push
git push -f origin HEAD^:master
# to get to previous commit (preserves working tree)
git reset --soft HEAD
# to get back to previous commit (you'll lose working tree)
git reset --hard HEAD^