Skip to content

Instantly share code, notes, and snippets.

View bnguyensn's full-sized avatar
Hacking away...

Binh Nguyen bnguyensn

Hacking away...
View GitHub Profile
@bnguyensn
bnguyensn / docker-notes.md
Last active March 18, 2020 15:17
Docker notes

Docker 🐋

Basics

A container is nothing but a running process, with added encapsulation features to keep it isolated from the host and other containers.

Each container interacts with its own private filesystem, provided by a Docker image.

alt text

@bnguyensn
bnguyensn / rsync-notes.md
Last active August 26, 2019 08:55
rysnc notes

rsync

Copy a file from local machine to remote server

$ rsync -a localdir/file username@host:remotedir
@bnguyensn
bnguyensn / jest-notes.md
Last active August 29, 2019 08:17
Jest notes

Jest

Mock

Mocking web APIs

Basic example

An example of how you could mock the fetch() function:

@bnguyensn
bnguyensn / nginx-notes.md
Last active September 9, 2019 21:59
nginx

nginx

Common commands

# Check version
$ nginx -v

# Check configuration syntax
$ sudo nginx -t
@bnguyensn
bnguyensn / .bashrc
Last active September 12, 2019 20:29
.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'
# ========== ALIASES ========== #
# ---------- System aliases ---------- #
alias home="cd ~"
@bnguyensn
bnguyensn / .eslintignore
Created October 29, 2019 21:53
Standard .eslintignore
node_modules
build
ignore
@bnguyensn
bnguyensn / .eslintrc.json
Created October 29, 2019 21:56
Standard .eslintrc.json
{
"extends": ["eslint:recommended", "prettier"],
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
@bnguyensn
bnguyensn / web-app-setup.md
Last active July 7, 2020 14:43
Steps to setup a modern development environment for a web application

Web Application Setup

These days, even if you start your application out with a framework like Gatsby or Next.js, you're still a few steps away from achieving a "proper" development environment.

This gist provides information on these steps. A JavaScript and a TypeScript version is provided for each step.

Note: This assumes you're building a React web application.

Table of Contents

@bnguyensn
bnguyensn / cloudSettings
Last active February 11, 2020 14:16
VSCode Settings Sync
{"lastUpload":"2020-02-11T14:16:27.784Z","extensionVersion":"v3.4.3"}
@bnguyensn
bnguyensn / python-project-notes.md
Last active February 22, 2020 11:52
Python project notes

Creating a Python project

This contains notes on creating Python projects

pip

pip comes with Python.

Useful commands:

  • pip list: list all globally installed packages