gist


  1. lazy git
  2. mysql clone database
  3. how to npm private module

lazy git

Add below code into your ~/.bash_profile(Mac) or ~/.bashrc(Linux)

# lazy git
function lgit() {
    git add .
    git commit --allow-empty-message -a -m "$1"
    git push
}

mysql clone database

srcdb=xxx.yyyyy.us-east-1.rds.amazonaws.com
destdb=xxxx.yyyyyyyy.us-east-1.rds.amazonaws.com
mysqldump -u $user -p$pass -h $srcdb mydb | mysql -u $user -p$pass -h $destdb mydb

npm private module

{
  "name": "my-app",
  "dependencies": {
    "my-module": "git+https://git@github.com/my-account/node-private-repo.git#0.0.1",
  }
}

You can also use https alternatively like “git+ssh://git@github.com:my-account/node-private-repo.git#0.0.1”. But you have to setup public key for github to get permission to clone with ssh protocol. Optional refspec (#v0.0.1) that tells npm which branch, commit, or tag you want to install.