Skip to content

Instantly share code, notes, and snippets.

View zandomed's full-sized avatar

Miguel Mendoza zandomed

View GitHub Profile
{
"Key Mappings": {
"0x9-0x40000": {
"Text": "",
"Action": 32
},
"0xf72b-0x100000": {
"Text": "",
"Action": 4
},

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@zandomed
zandomed / abstract-unique-validator.ts
Created May 18, 2021 05:05 — forked from zarv1k/abstract-unique-validator.ts
Unique Validator Example for NestJS
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm';
interface UniqueValidationArguments<E> extends ValidationArguments {
constraints: [
ObjectType<E> | EntitySchema<E> | string,
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E,
];
}