Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / docker-compose.yml
Created May 18, 2024 15:35
PostgreSQL & PgAdmin
services:
db:
container_name: postgres_database
image: postgres:16.3
volumes:
- ./postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=123456
restart: always
ports:
@Klerith
Klerith / payments.data.ts
Created May 13, 2024 12:29
Generador de data para pruebas
import { v4 as uuidV4 } from "uuid";
import { uniqueNamesGenerator, Config, names } from "unique-names-generator";
const config: Config = {
dictionaries: [names],
};
export type Payment = {
id: string;
amount: number;
@Klerith
Klerith / instalaciones-shadcn.md
Last active May 9, 2024 19:52
Instalaciones recomendadas para el curso de Shadcn/ui
@Klerith
Klerith / layout.tsx
Last active May 8, 2024 14:57
Admin Layout para el curso de Shadcn/ui
// https://tailwindcomponents.com/component/tailwind-css-admin-dashboard-layout
// https://gist.github.com/Klerith/3949f1c8b884d7101e378dfb668f0f3a
import Link from "next/link";
const links = [
{ name: "accordion", href: "accordion" },
{ name: "alert", href: "alert" },
];
{
mixed: {
default: 'No es válido',
required: 'Este campo es requerido',
oneOf: 'Debe ser uno de los siguientes valores: ${values}',
notOneOf: 'No debe ser uno de los siguientes valores: ${values}',
defined: 'Debe estar definido',
notNull: 'No puede ser nulo',
notType: 'Debe ser de tipo ${type}',
},
@Klerith
Klerith / yup.ts
Last active April 30, 2024 15:30
Configuración en español global para Yup
import * as yup from 'yup';
// Establecer el idioma de los mensajes de error en español
yup.setLocale({
mixed: {
default: 'No es válido',
required: 'Este campo es requerido',
oneOf: 'Debe ser uno de los siguientes valores: ${values}',
notOneOf: 'No debe ser uno de los siguientes valores: ${values}',
defined: 'Debe estar definido',
@Klerith
Klerith / VueRouterTemplate.vue
Last active April 12, 2024 12:44
Template para nuestro ejercicio de Vue Rotuer
<template>
<div class="flex flex-col h-screen">
<!-- Header -->
<header class="flex items-center h-14 px-4 border-b border-gray-300 sm:h-16 md:px-6 lg:px-8">
<div>
<a class="flex items-center gap-2 font-semibold" href="#">
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="40" height="40" />
</a>
</div>
.fade-in {
animation: fadeIn 0.3s;
-webkit-animation: fadeIn 0.3s;
-moz-animation: fadeIn 0.3s;
-o-animation: fadeIn 0.3s;
-ms-animation: fadeIn 0.3s;
}
@keyframes fadeIn {
0% {opacity:0;}
100% {opacity:1;}
@Klerith
Klerith / tsconfig.vitest.json
Created April 5, 2024 16:22
Archivo de configuración de TypeScript para Vitest
{
"extends": "./tsconfig.app.json",
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
"lib": [],
"types": ["node", "jsdom", "vitest/globals"]
}
}