Skip to content

Commit

Permalink
Merge pull request #56 from vungoccuong/master
Browse files Browse the repository at this point in the history
Add more cheatsheets
  • Loading branch information
denisidoro authored Oct 14, 2019
2 parents cf090d5 + a74f5c4 commit 2993608
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cheats/docker-compose.cheat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Builds, (re)creates, starts, and attaches to containers for all services
docker-compose up

# Builds, (re)creates, starts, and dettaches to containers for all services
docker-compose up -d

# Builds, (re)creates, starts, and attaches to containers for a service
docker-compose up -d <service_name>

# Builds, (re)creates, starts, and dettaches to containers for a service
docker-compose up -d <service_name>

# Print the last lines of a service’s logs
docker-compose logs --tail 100 <service_name> | less

# Print the last lines of a service's logs and following its logs
docker-compose logs -f --tail 100 <service_name>

# Stops containers and removes containers, networks created by up
docker-compose down
6 changes: 6 additions & 0 deletions cheats/docker.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ docker exec -it <container_id> bash
# Print the last lines of a container’s logs
docker logs --tail 100 <container_id> | less

# Print the last lines of a container's logs and following its logs
docker logs --tail 100 <container_id> -f

# Create new network
docker network create <network_name>

$ image_id: docker images --- --headers 1 --column 3
$ container_id: docker ps --- --headers 1 --column 1
15 changes: 15 additions & 0 deletions cheats/git.cheat
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,19 @@ navi fn url::open 'https://github.com/pulls?&q=author:<user>+is:open+is:pr'
git fetch origin pull/<pr_number>/head:pr/<pr_number> \
&& git checkout pr/<pr_number>

# Add a new module
git submodule add <repository> [<path>]

# Update module
git submodule update --init

# Update module without init
git submodule update

# Pull all submodules
git submodule foreach git pull origin master

# Update all submodules
git submodule update --init --recursive

$ branch: git branch | awk '{print $NF}'
20 changes: 20 additions & 0 deletions cheats/npm.cheat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# initial new package
npm init

# initial immediately a new package
npm init -y

# install all dependencies packages
npm install

# install all dev dependencies packages
npm install --save-dev

# install a specified package
npm install <package_name>

# install a specified dev package
npm install <package_name> --save-dev

# install globally a specified package
npm install <package_name> -g
11 changes: 11 additions & 0 deletions cheats/nvm.cheat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# install a specified version of node
nvm install <version>

# list available versions
nvm ls-remote

# use installed node's version
nvm use <version>

# set a node's version as default
nvm alias default <version>

0 comments on commit 2993608

Please sign in to comment.