Skip to content

Instantly share code, notes, and snippets.

@tuanngominh
tuanngominh / pragmatic-share-type-angular-cloud-function.ts
Last active June 19, 2018 04:10
Pragmatic solution for sharing type between angular and firebase cloud function
// cloud function
import {type1} from `../../feature1`; //relative import
// angular
import {type1} from `@app/shared/feature1`
// angular's tsconfig.json
{
"compilerOptions": {
"paths": {
@tuanngominh
tuanngominh / setup.sh
Last active September 16, 2018 06:50
setup python3 on mac OS X, High Sierra
# Install homebrew, check https://brew.sh/#install
# Install python3 with homebrew
brew install python
# View guide to link python to python3
brew info python
# From the guide, link python to python3 by adding /usr/local/opt/python/libexec/bin to PATH in
vi ~/.zshrc
@tuanngominh
tuanngominh / common-python-command.sh
Last active September 13, 2018 05:18
Common python command
# Create a virtual environment for a project:
cd repos
virtualenv project1
# To begin using the virtual environment, it needs to be activated:
source project1/bin/activate
# From now on, any package that you install using pip will be placed in the project1 folder,
# isolated from the global Python installation.
# Install packages as usual, for example:
@tuanngominh
tuanngominh / django_with_vscode.sh
Last active September 13, 2018 07:47
Setup django with vscode
# Goals:
# - Setup django with virtual environment so can lint correctly in VScode
# Steps:
# Using venv instead of virtualenv
# Install package, run server in VSCode's python terminal
# Enable django for pylint, add to VSCode's setting: "python.linting.pylintArgs": ["--load-plugins", "pylint_django"]
# References
# - https://github.com/Microsoft/vscode-python/issues/1185
@tuanngominh
tuanngominh / docker-cheatset.md
Last active September 17, 2019 03:32
docker, docker composer cheatseat
@tuanngominh
tuanngominh / pipenv.sh
Last active April 19, 2019 05:05
pipenv
# DEBUG --------------------
# remove all packages from virtualenv but keep the Pipfile unchanged
pipenv uninstall --all
# show the dependency from installed package in virtual env, not the package in Pipefile or Pipefile.lock
pipenv graph
# using iterm session log to store log to file
pipenv lock --verbose
@tuanngominh
tuanngominh / typescript diagram tool.md
Last active April 2, 2020 03:20
typescript diagram tool case study
@tuanngominh
tuanngominh / migrate-out-of-nx-workspace.md
Last active October 18, 2019 08:35
Migrate out of NX workspace study

monorepo for multiple languages apps

Goal:

  • Every apps work with each other in a single commit.
  • No need to manage versions between different apps in different repos.
  • Each language has its own advantages in one area like python is good for data crunching, typescript is working well with nosql db and only good option in angular.

Challenge:

Development flow for apps in different languages.

Each language like js has npm for running command like lint, code format, test, install dependency; nx, lerna for monorepo.