Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / cloudbuild.yml
Last active April 30, 2024 04:29
cloudbuild.yml con secretos
steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- -c
- |
docker build -t XXXXXX-docker.pkg.dev/project/image-registry/image-name -f dockerfile.prod --platform=linux/amd64 --build-arg ORDERS_DATABASE_URL=$$DATABASE_URL .
secretEnv: ['DATABASE_URL']
- name: 'gcr.io/cloud-builders/docker'
@Klerith
Klerith / cloudbuild.yml
Last active April 29, 2024 21:08
Google Cloud - Build steps
steps:
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"XXXXX-docker.pkg.dev/project-name/registry/image-name",
"-f",
"dockerfile.prod",
"--platform=linux/amd64",
@Klerith
Klerith / README.md
Created March 6, 2024 16:41
Pasos para configurar y crear sub-módulos en Git y Github

Pasos para crear los Git Submodules

  1. Crear un nuevo repositorio en GitHub
  2. Clonar el repositorio en la máquina local
  3. Añadir el submodule, donde repository_url es la url del repositorio y directory_name es el nombre de la carpeta donde quieres que se guarde el sub-módulo (no debe de existir en el proyecto)
git submodule add <repository_url> <directory_name>
  1. Añadir los cambios al repositorio (git add, git commit, git push)
@Klerith
Klerith / tsconfig.json
Created October 19, 2023 20:52
TSConfig para paquetes de NPM
{
"compilerOptions": {
// Para archivos de declaraciones
"outDir": "dist",
"target": "ES2020",
"declaration": true,
"allowJs": true,
"emitDeclarationOnly": false,
"declarationMap": false,
@Klerith
Klerith / configurar-node-ts.md
Last active April 30, 2024 16:49
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
@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
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
@Klerith
Klerith / pasos-node-typescript.md
Last active May 1, 2024 19:17
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-next.md
Last active May 1, 2024 19:42
Instalaciones recomendadas para el curso de Next.js 13 >
@Klerith
Klerith / Dockerfile
Last active April 19, 2024 13:40
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 / index.ts
Last active April 30, 2024 18:27
Vuex + TypeScript - Store Structure Strongly Typed
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;