Skip to content

Instantly share code, notes, and snippets.

View TomasCuevas's full-sized avatar
馃幆
Focusing

Tom谩s Cuevas TomasCuevas

馃幆
Focusing
View GitHub Profile
@TomasCuevas
TomasCuevas / git-alias.md
Created May 18, 2023 02:14 — 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

@TomasCuevas
TomasCuevas / Dockerfile
Created January 19, 2023 16:02 — forked from Klerith/Dockerfile
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
@TomasCuevas
TomasCuevas / time-since.ts
Created November 11, 2022 16:17 — 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;
@TomasCuevas
TomasCuevas / templateSlice.js
Last active June 27, 2022 15:29 — forked from Klerith/templateSlice.js
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 */ ) => {
state.counter += 1;
@TomasCuevas
TomasCuevas / vite-testing-config.md
Created June 17, 2022 16:02 — 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: