Skip to content

Instantly share code, notes, and snippets.

View YourAKShaw's full-sized avatar
:electron:
tapping away on my keyboard _</>...

Ayush Kumar Shaw YourAKShaw

:electron:
tapping away on my keyboard _</>...
View GitHub Profile

Building efficient, reliable, and secure REST APIs involves following several best practices. Here's a detailed breakdown of these practices, including versioning, security, and optimization techniques for your NestJS-based microservice:

1. API Design & Structure

  • Resource Naming: Use meaningful, clear, and consistent names for your endpoints (e.g., /movies, /movies/{id}). Prefer nouns for resources and use HTTP methods to represent actions (GET, POST, PUT, DELETE).
  • HTTP Methods:
    • GET for reading data.
    • POST for creating resources.
    • PUT or PATCH for updating resources.
    • DELETE for removing resources.
  • Use HTTP Status Codes: Return appropriate status codes (e.g., 200 for success, 201 for created, 404 for not found, 400 for bad request, 500 for server errors).

Using NeoVim effectively requires mastering its keybindings, understanding how to navigate between modes, and leveraging plugins and customization to streamline your workflow. Here's a structured guide to get you started and maximize your efficiency:

1. Master the Modes

NeoVim has multiple modes, and the most effective way to use it is by switching between them efficiently.

  • Normal Mode: This is the default mode (press Esc to enter it).

    • In this mode, you move around and manipulate text without actually inserting any.
  • Insert Mode: This is the mode for typing text (enter it by pressing i, a, o, etc.).

To use NeoVim with style, you'll want to configure it for both productivity and aesthetics. Below is a step-by-step tutorial to set up a stylish NeoVim environment.

1. Install NeoVim

First, make sure you have NeoVim installed. You can install it by following the instructions for your system:

  • Linux:
    sudo apt update && sudo apt install neovim
  • macOS:
@YourAKShaw
YourAKShaw / namaste_javascript_notes.md
Last active September 13, 2024 09:32
Namaste 🙏 JavaScript is a YouTube playlist by Akshay Saini. These are the notes I've made when I was learning JavaScript from Scratch using the playlist.

How JavaScript Works?

Is JavaScript:

  • Synchronous or Asynchronous?
  • Single-threaded or Multi-threaded?
  • Everything in JavaScript happens inside an Execution Context
    • You can assume this execution context to be a big box or a container in which the whole JavaScript code is executed.
  • This big box has two components in it: