Skip to content

Instantly share code, notes, and snippets.

View truongluu's full-sized avatar
🏠
Working from home

Lưu Xuân Trường truongluu

🏠
Working from home
View GitHub Profile
@truongluu
truongluu / ReactNative-Deep-Dive.md
Created December 16, 2020 02:30 — forked from nsimmons/ReactNative-Deep-Dive.md
ReactNative Deep Dive
@truongluu
truongluu / handling_multiple_github_accounts.md
Created December 8, 2020 04:54 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@truongluu
truongluu / handling_multiple_github_accounts.md
Created December 8, 2020 04:54 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@truongluu
truongluu / handling_multiple_github_accounts.md
Created December 8, 2020 04:54 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@truongluu
truongluu / handling_multiple_github_accounts.md
Created December 8, 2020 04:54 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@truongluu
truongluu / handling_multiple_github_accounts.md
Created December 8, 2020 04:54 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@truongluu
truongluu / local-mongo-replicaset-with-docker
Created November 10, 2020 03:43 — forked from oleurud/local-mongo-replicaset-with-docker
[Local mongo replicaset with docker] #docker #mongo
# pull the official mongo docker container
docker pull mongo
# create network
docker network create my-mongo-cluster
# create mongos
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019
@truongluu
truongluu / multi-level-group-by.js
Created June 17, 2020 03:33 — forked from fatihky/multi-level-group-by.js
multi level group by, lodash, collections
const _ = require('lodash')
function genrows(groups, groupKey) {
return _.toPairs(groups)
.map(([key, data]) => ({[groupKey]: key, data}))
}
function gengroups(arr, iteratee, key) {
const grouped = _.groupBy(arr, iteratee)
return genrows(grouped, key)
@truongluu
truongluu / multiple_ssh_setting.md
Created June 16, 2020 06:46 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@truongluu
truongluu / layouts.ts
Created April 27, 2020 13:49 — forked from xxRockOnxx/layouts.ts
React Native Navigation with react-native-vector-icons
interface Layouts {
[name: string]: LayoutRoot;
}
const layouts: Promise<Layouts> = new Promise(resolve => {
Promise.all([
Icon.getImageSource("people"),
Icon.getImageSource("message")
]).then(icons => {
resolve({