Skip to content

Instantly share code, notes, and snippets.

View lemissel's full-sized avatar
🚀

Leandro Missel lemissel

🚀
View GitHub Profile
@lemissel
lemissel / howto.md
Created July 3, 2021 02:48
Multiple Github accounts on the same computer
  1. Generate as SSH-key ssh-keygen -t rsa -C "john@doe.com", folow the prompts and decide a name, e.g. id_rsa_doe_company.
  2. Copy the SSH public-key to GitHub from ~/.ssh/id_rsa_doe_company.pub and tell ssh about the key: ssh-add ~/.ssh/id_rsa_doe_company.pub
  3. Create a fongi file in ~/.ssh with the follownig contents:
HOST github-doe-company
  HostName github.com
  User git
  IdentityFIle ~/.ssh/ir_rsa_doe_company
  1. Add yout remote git remote add origin git@github-doe-company:username/repo.git or git remote set-url origin git@git-doe-company:username/repo.git
// WARNING: This is a simple anotation. Don`t run this code
type Operador func(int, int) int
type Calculadora struct {
op Operador
}
func (c Calculadora) Calcular(a int, b int) int {
return c.op(a,b)
}
// WARNING: This file is a simple annotation and don`t run
type Person struct {
Name string
Age int
}
func (p Person) Greet() {
fmt.Println("Hi! I'm %s", p.Name)
}
@lemissel
lemissel / commands
Created July 3, 2021 01:19
Micro tutorial how to up a Prometheus Docker container
sudo mkdir -p /docker/prometheus
docker run -d -p 9090:9090 \
--name prometheus \
-v /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
docker stop prometheus
@lemissel
lemissel / simpliestMigrationexemple.ts
Created October 14, 2020 10:58
Simplest Migration Exemple
import {MigrationInterface, QueryRunner} from "typeorm";
export class ModifySomething implements MigrationInterface {
name = 'ModifySomething987982495702935873450987'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query("ALTER TABLE `syndicate` ADD CONSTRAINT `FK_sd9f8g7s8df6g89f6s87dfg` FOREIGN KEY (`addressId`) REFERENCES `address`(`id`) ON DELETE CASCADE ON UPDATE CASCADE");
await queryRunner.query("ALTER TABLE `address` ADD CONSTRAINT `FK_c76sdf8g6sdf87g6s9g67` FOREIGN KEY (`companyId`) REFERENCES `company`(`id`) ON DELETE CASCADE ON UPDATE CASCADE");
}
@lemissel
lemissel / launch.json
Last active August 28, 2020 16:54
launch.json configuration for Nestjs debbuging with VSCode
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/src/main.ts",
"preLaunchTask": "tsc: watch - tsconfig.build.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],