Skip to main content

Wednesday, July 19, 2023

· 2 min read
  • I still prefer os.path over Pathlib, as follows
  1. Consistency, I'm used to use path string as an argument between functions and I think Pathlib is not flexible enough to handle arguments
  2. Pure and Function, Although Pathlib brings many useful features like glob, stem, and so on. I still like the concept of simplicity that don't put all things together!
  • Trim $ for clipboard copy in Docusaurus in code block bash.

Ignore $ for clipboard copy · Issue #1745 · facebook/docusaurus · GitHub

  • Some common issues I often hit when using git

Configure username/password for different repos or remotes

Global configuration

git config --global --list
git config --local --list

GIT two popular authentication methods:

  • ssh key

How to Authenticate Your Git to GitHub with SSH Keys

  • git credentials

Store username/password instead of ssh for multiple remotes

To enable git credentials

# local
git config credential.helper store
# global
git config --global credential.helper store

Each credential is stored in ~/.git-credentials file on its own line as a URL like:

https://<USERNAME>:<PASSWORD>@github.com

Configure credentials,

# Global
git config --global credential.https://github.com.username <your_username>

# Or
git config --local user.name <your_username>
git config --local user.email <your_useremail>
# Then git pull or git push to let it cache your username/password after it prompt you to input password in the first time

Alternatively, we can directly edit our global Git config file ~/.gitconfig,

[credential "https://github.com"]
username = <username>

Git - Config Username & Password - Store Credentials - ShellHacks

Configuring Git Credentials

  • Programming Algorithms

Top Algorithms Every Programmer Should Know

What is Algorithm | Introduction to Algorithms - GeeksforGeeks