Skip to content

Instantly share code, notes, and snippets.

View pnhoang's full-sized avatar

Hoang Pham pnhoang

View GitHub Profile
@pnhoang
pnhoang / clean-up-scripts.sh
Last active December 6, 2023 15:21
Clean up Macbook
# The following scripts can be run from within your `~/dev` or `~/develop` or whatever folder you have for storing your source code as a developer.
# Since, node_modules, .next or cdk.out are folders that can be re-created by running their respective install commands.
# Using these 3 commands, I saved around 15GB of disk space.
```
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
find . -name ".next" -type d -prune -exec rm -rf '{}' +
find . -name "cdk.out" -type d -prune -exec rm -rf '{}' +
```
@pnhoang
pnhoang / debug-vuejs.md
Last active July 7, 2023 09:21
Debug Vue.js application from VSCode

This document shows you how to debug Vue.js application from VS Code. https://v2.vuejs.org/v2/cookbook/debugging-in-vscode.html

The only problem that I get is that when I launched the debugger, it always opens the http://localhost:8080. And that's not what I want.

Instead, I want the debugger to start and step into the breakpoints when I open a link with Router directly for the first time.

An example: http://localhost:8080/#/IT/it/

In this case, what I did is: in VS Code, open the Command Palette: Cmd + Shift + P. Type in: Debugger: Open Link

@pnhoang
pnhoang / how-to-build-cli-with-node-js-using-oclif.md
Created October 10, 2019 22:58
How to build a CLI in Node.js using Oclif Framework

Single command vs Multiple command CLI

curl -h
curl http://google.com

heroku -h
heroku logs -a app-name
heroku 
@pnhoang
pnhoang / howto-download-youtube-videos.md
Last active April 9, 2024 12:19
How to download ALL videos of ANY YouTube Channel

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@pnhoang
pnhoang / dev-notes.md
Last active June 4, 2019 14:35
Dev Notes

Troubleshooting Prisma

UnhandledPromiseRejectionWarning: Error: Project not found: 'default$default'

$ docker ps
$ docker logs -f <container-id>

Connecting to Postgres Container using Postico, same connection, user/password, databasename is also prisma.

@pnhoang
pnhoang / gatsby.md
Last active May 23, 2019 21:26
Gatsby presentation
@pnhoang
pnhoang / terminal.md
Last active September 7, 2018 14:18
Terminal Utilities

You can use Ctrl+U to clear up to the beginning.

You can use Ctrl+W to delete just a word.

You can also use Ctrl+C to cancel.

If you want to keep the history, you can use Alt+Shift+# to make it a comment.

$ brew install mongodb

$ brew services start mongodb

$

Notes from the docker workshop

docker ps

docker run -d -p 9000:80 nginx:latest

docker rm -f id-container

docker images