Skip to content

Instantly share code, notes, and snippets.

View ngohuytrieu's full-sized avatar
👨‍🍳
Coding is cooking

TRIEU NGO HUY ngohuytrieu

👨‍🍳
Coding is cooking
View GitHub Profile
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active July 22, 2024 13:33
Using multiple github accounts with ssh keys

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.
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@diogocapela
diogocapela / moment-js-timezones.txt
Created September 7, 2018 00:10
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@HoussemNasri
HoussemNasri / BalsamiqForever.py
Last active July 5, 2024 16:28
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
@ngohuytrieu
ngohuytrieu / macos-useful-tips.md
Last active June 21, 2023 07:51
MacOS Useful tips

Enable command auto suggestion in terminal

sudo nano ~/.inputrc

# Add following content
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete

# close terminal then try again