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
@ngohuytrieu
ngohuytrieu / macOS-install-apache-config-virtual-host.md
Last active October 12, 2022 03:24
Setup apache and config virtual host on macOS

Setup apache and config virtual host on macOS

Since macOS Sierra 10.x apache has been built-in. Run these command to start / restart / stop apache

sudo /usr/sbin/apachectl start
sudo /usr/sbin/apachectl stop
sudo /usr/sbin/apachectl restart
sudo /usr/sbin/apachectl status

DocumentRoot

@ngohuytrieu
ngohuytrieu / docker-enoent-error.md
Created March 3, 2022 06:22
Docker error "npm ERR! enoent undefined ls-remote -h -t"

npm ERR! enoent undefined ls-remote -h -t

RUN apk add --no-cache git

@ngohuytrieu
ngohuytrieu / package-vs-package-lock.md
Last active December 6, 2021 10:11
package.json vs package-lock.json

Different

  • package.json: list of module needs for project
  • package-lock.json: same idea but with lock specific version that already works when run npm i from package.json

Why do we need package-lock.json

  • Semantic Versioning (semver) has structure like: ^MAJOR.MINOR.PATCH
  • With ^ when run npm i it will install newest version of the same MAJOR. But with the newest MINOR or PATCH (install on new pc) could cause some issue or bug
  • The package-lock.json solves this by defining the MAJOR.MINOR.PATCH preciously that works.

Install

@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