Skip to content

Instantly share code, notes, and snippets.

View PterPmnta's full-sized avatar
💭
Js.Learn(Angular - Node);

Pedro Pimienta M. PterPmnta

💭
Js.Learn(Angular - Node);
View GitHub Profile
@gugadev
gugadev / http.ts
Created July 15, 2023 21:54
Small utility to remote data fetching using polymorfism to allow distinct implementations.
/**
* @description Constituye un catálogo de errores de una API.
* Un catálogo es un mapa en donde se asocia un código de error
* con un mensaje describiendo el problema que se ha originado.
* Por ejemplo:
* {
* 24323: 'Ha ocurrido un error consumiendo el servicio externo ABC',
* 13424: 'No se encontraron coincidencias para la búsqueda'
* }
*/
@Klerith
Klerith / basic.html
Last active July 19, 2024 17:02
Páginas que usaremos en la sección de Formularios Reactivos
<h2>Reactivos: Básicos</h2>
<hr>
<div class="row">
<div class="col">
<form autocomplete="off">
<!-- Campo de producto -->
<div class="mb-3 row">
@Klerith
Klerith / tarea-pg-admin.md
Last active July 19, 2024 16:07
Tarea sobre PGAdmin y Postgres

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 / Dockerfile
Last active July 18, 2024 18:27
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
@minhanhhere
minhanhhere / Instruction.md
Last active June 19, 2024 14:01
Customise Your Terminal Using Zsh & powerlevel10k

What we will setup

1. ZSH

ZSH, also called the Z shell, is an extended version of the Bourne Shell (sh), with plenty of new features, and support for plugins and themes.

2. oh-my-zsh

This is a framework for zsh

3. Powerlevel 10k

Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.

@wparad
wparad / responsive-toolkit.js
Last active October 5, 2021 10:19
Reactive javascript triggered by bootstrap media queries
const xs = document.createElement('div');
xs.setAttribute('class', 'd-inline d-sm-none');
const sm = document.createElement('div');
sm.setAttribute('class', 'd-none d-sm-inline d-md-none');
const md = document.createElement('div');
md.setAttribute('class', 'd-none d-md-inline d-lg-none');
const lg = document.createElement('div');
@Klerith
Klerith / db.json
Last active March 9, 2023 19:51
Base de datos rápida - json-server
{
"usuarios": [
{
"id": 1,
"usuario": "John Doe",
"email": "john.due@gmail.com"
}
],
"heroes": [
{
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
rules: {
@vades
vades / angular-expression-changed.md
Last active July 18, 2024 19:44
Fixing "Expression has changed after it was checked" in Angular

Fixing "Expression has changed after it was checked" in Angular

The exception appears (in the development mode) at the moment the value is checked and value is different of the updated value.

Error message example

AppComponent.html:1 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: true'. Current value: 'ngIf: false'.
    at viewDebugError (core.js:20440)
    at expressionChangedAfterItHasBeenCheckedError (core.js:20428)
    at checkBindingNoChanges (core.js:20530)
@toraritte
toraritte / add_user_and_reset_password_with_Firebase_admin_on_node.md
Last active May 10, 2024 13:10
Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

1. Install Firebase's Node modules

Install the Firebase Node modules:

$ npm install firebase firebase-admin --save