Skip to content

Instantly share code, notes, and snippets.

View vhbui02's full-sized avatar

VH vhbui02

View GitHub Profile
@vhbui02
vhbui02 / web-best-practices.md
Last active December 31, 2023 12:27
[Web best practices] Some cool things I note when I'm learning on Internet

Best practice for RESTful API design

Parameters

  • Path Params: identify a specific resource of resources
  • Query Params: soft/filter resources

Example: RESTful API endpoints for an entity called Car

Path params

  • GET /cars
  • GET /cars/:id
@vhbui02
vhbui02 / overleaf.md
Last active December 25, 2023 18:12
[Overleaf learning] Wanna try to write report/thesis/article using different tool

Why use Latex?

  • Complex mathmatics, tables and technical contents
  • Footnotes, cross-ref, biblio
  • Indexes, Glossaries, ToC, List of Figures, List of Tables,...
  • Highly customizable, intrinsic programmability
  • Thousands of free add-ons
  • LaTeX file create template which author can use to write many papers
  • Thousand of templates: articles, reports, books, CVs, ...

Cheat sheet

@vhbui02
vhbui02 / mode.md
Last active January 27, 2024 07:32
[read/write mode] Some mode you gonna use when try to read/write file
Character Meaning
'r' Open for reading (default)
'w' Open for writing (note: truncate)
'x' Open for exclusive creaation (failed if the file already exists)
'a' Open for writing, appending to the end of file if it exists
'b' Binary mode
't' Text mode (default)
'+' Open for updating (reading and writing)
@vhbui02
vhbui02 / coding-exp.md
Last active January 29, 2024 17:37
[Some coding experience that I've deduced] Some real shjts that made me waste a lot of time to know
  1. Never, ever, code first, design later. Always design first. You must learn how to do system design.
  2. Stop rewriting 10 times, again, design first.
  3. Don't try to implement UX inside or implementing Data Separation from Code if you are the only one that use this tool.
  4. Try to find the libraries, framework that associated with the technology you're currently using. Trust me, it will help you a lot. Don't try to do everything from scratch again, nobody is gonna appreciate you just because you can reimplement something. If you are learning tutorial? yeah it is a must. But if you're working, please don't.
  5. Always strike to design in a general way, DRY principle.
  6. Always weights pros and cons of your Tech Stack. Always evaluate enough to meet demands.
  7. Keep caching techniques (memoization, ...) in mind, I suppose this also included in best practice section in roadmap.sh
@vhbui02
vhbui02 / stuff-im-learning.md
Last active December 14, 2023 08:26
[Stuff I'm learning] Most of them are spur-of-the-moment Q & A that lead to the following list
@vhbui02
vhbui02 / google-cloud-iam.md
Created December 13, 2023 04:03
[IAM learning] Learning about Google Cloud IAM #google-cloud

Usage

  • Grant granular access to specific resources
  • Prevent access to other resources
  • Adopt the security principle of least privilege (nobody should have more permissions that they need)

Mechanism

who (identity) has what access (role) for which resource.

Example of resources

A1: Compute Engine VM instances, GKE, Cloud Storage buckets, ...

@vhbui02
vhbui02 / google-cloud-command.md
Last active December 13, 2023 18:24
[Google Cloud] Anything that i can't google in 5 min

Google Cloud APIs

2 types of Client Libraries: Google API Client Libraries vs Cloud Client Libraries: https://stackoverflow.com/a/41354013/9122512

Example of Google API Client Libraries: https://github.com/googleapis/google-api-python-client

@vhbui02
vhbui02 / matlab.md
Last active December 10, 2023 04:24
[matlab cheatsheet] something i've learned when researching AI paper

To display size, use size() or whos

To change from column to row or vise versa, use single quote at the end of that variable: row_cell', col_cell'

To concatenate row-by-row: [<mx1 cell>; <nx1 cell>; <px1 cell>]

To concatenate col-by-col: [<1xm cell> <1xn cell> <1xp cell>] (no semicolon)

Record variable-in-function to base workspace: assignin('base', "f_fexp", f) %debug

@vhbui02
vhbui02 / os-module-python.md
Last active November 6, 2023 11:40
[os module] some method I will use and try to remember

os module

os.chdir() # Change current working dir os.environ # Return an object, value = List of all env vars os.environ.get() # Access env var + def value + no exception (return None) os.environ[] # Access env var + no def + yes exception (KeyError) os.getcwd() # Get current working dir os.getenv() # Access env var + def value + no exception (return None) os.listdir() # Returns a List contains files and subdirectories os.mkdir() # Add new folder

@vhbui02
vhbui02 / cut.md
Created October 17, 2023 15:05
[cut command] again, tomorrow i will have absolutely no idea what this is

cut OPTION [FILE]

FILE

If FILE is specified, it's a list of file names If FILE isn't specified, or when it's -, it's standard input => enable pipelining

Mandatory option

-d / --delimiter=DELIM: specify input delimiter character instead of TAB for file delimiter