Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / Dockerfile
Last active December 11, 2024 21:12
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 / patrones-recursos.md
Created November 19, 2024 14:33
Recursos adicionales - Patrones de diseño
@Klerith
Klerith / react-index.html
Created May 6, 2020 19:07
Introducción a React
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- Cargat React -->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
@Klerith
Klerith / pasos-node-typescript.md
Last active December 11, 2024 03:21
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@Klerith
Klerith / instalaciones-react-native-expo.md
Last active December 11, 2024 03:03
Instalaciones recomendadas para el curso de React Native Expo
React Native Logo Expo Logo
Docs React Native Docs Expo

Curso de React Native - Expo

Esta es la lista de instalaciones recomendadas para el curso de React Native, si encuentran enlaces adicionales o cambios en esta hoja, pueden hacerlos.

@Klerith
Klerith / email.dart
Created March 18, 2023 14:15
Flutter - Formz Inputs
import 'package:formz/formz.dart';
// Define input validation errors
enum EmailError { empty, format }
// Extend FormzInput and provide the input type and error type.
class Email extends FormzInput<String, EmailError> {
static final RegExp emailRegExp = RegExp(
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$',
@Klerith
Klerith / time-since.ts
Created November 2, 2022 20:36
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;
@Klerith
Klerith / layout.tsx
Last active December 10, 2024 20:58
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" },
];
@Klerith
Klerith / instalaciones-angular-pro.md
Last active December 10, 2024 19:49
Instalaciones recomendadas para el curso de Angular Pro