Skip to content

Instantly share code, notes, and snippets.

Avatar
📓

Fernando Klerith

📓
View GitHub Profile
View email_pattern.dart
String pattern = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regExp = new RegExp(pattern);
@Klerith
Klerith / flutter-instalaciones.md
Last active April 1, 2023 23:13
Instalaciones del curso de Flutter - Móvil de cero a experto
View flutter-instalaciones.md
@Klerith
Klerith / Dockerfile
Last active April 1, 2023 19:26
Preparar imagen de Docker - Node App
View Dockerfile
# 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 / tarea-pg-admin.md
Last active March 31, 2023 22:06
Tarea sobre PGAdmin y Postgres
View tarea-pg-admin.md

Docker Hub images

Postgres

pgAdmin

1. Crear un volumen para almacenar la información de la base de datos

docker COMANDO CREAR postgres-db

2. Montar la imagen de postgres así

OJO: No hay puerto publicado -p, lo que hará imposible acceder a la base de datos con TablePlus

@Klerith
Klerith / templateSlice.js
Last active March 31, 2023 18:56
Cascaron para crear Redux Slices rápidamente
View templateSlice.js
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@Klerith
Klerith / estilos-basicos.css
Created December 1, 2020 19:01
Estilos básicos para la introducción de Angular
View estilos-basicos.css
* {
font-family: Helvetica, Arial, sans-serif;
font-weight: 200;
}
html, body {
background: white;
margin: 20px;
color: #3e4144;
@Klerith
Klerith / Instalaciones-React.md
Last active March 31, 2023 14:06
Instalaciones recomendadas para mi curso de React de cero a experto
View Instalaciones-React.md
@Klerith
Klerith / index.ts
Last active March 31, 2023 05:24
Vuex + TypeScript - Store Structure Strongly Typed
View index.ts
import { createStore } from 'vuex';
// My custom modules
import exampleModule from './module-template';
import { ExampleStateInterface } from './module-template/state';
export interface StateInterface {
// Define your own store structure, using submodules if needed
// example: ExampleStateInterface;
@Klerith
Klerith / instalaciones-react-query.md
Last active March 31, 2023 02:20
Instalaciones recomendadas para el curso de React Query
View instalaciones-react-query.md
@Klerith
Klerith / vite-testing-config.md
Last active March 30, 2023 21:08
Vite + Jest + React Testing Library - Configuraciones a seguir
View vite-testing-config.md

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: