Skip to content

Instantly share code, notes, and snippets.

View angelcgar's full-sized avatar
🎯
Focusing

Angel Contreras Garcia angelcgar

🎯
Focusing
View GitHub Profile
Act as an expert Prompt Engineer. Your primary reference for this task is the provided book: 'Prompt Engineering' by Lee Boonstra.
When I give you a prompt that I want to improve, which we'll call [User_Prompt_To_Improve], your objective is to analyze it and then transform it into an optimized version. This optimized version should be designed to take the biggest advantage of Gemini, based strictly on the principles, techniques, and best practices detailed in this book.
Your response should provide two key components:
The Optimized Prompt: Present the rewritten, improved version of [User_Prompt_To_Improve].

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;