Skip to content

Instantly share code, notes, and snippets.

View gpsarkar's full-sized avatar
💭
🚀

Ganapati Sarkar gpsarkar

💭
🚀
View GitHub Profile
@gpsarkar
gpsarkar / k8s-deployment-strategies.md
Last active July 9, 2024 09:27
k8s-deployment-strategies

When deploying applications to Kubernetes (K8s), several deployment strategies can be used depending on the requirements for uptime, risk mitigation, and resource management. Here are some common deployment strategies, including commit-based deployment:

1. Rolling Updates

Description: Gradually updates instances of the application one at a time. This ensures that there is no downtime, but it can be slower.

Steps:

  1. Start updating the instances one by one.
  2. Wait for the new instance to be up and running before updating the next one.
  3. Continue until all instances are updated.
@gpsarkar
gpsarkar / node-api-project-boilerplate.md
Last active November 4, 2023 08:37
node express based api project boilerplate

Best practices and modular structuring for an enterprise-level Node.js API project using TypeScript:

Step 1: Project Initialization and Dependency Installation

mkdir my-typescript-api
cd my-typescript-api
npm init -y
npm install typescript express dotenv helmet cors
npm install --save-dev @types/node @types/express @types/cors ts-node nodemon eslint
@gpsarkar
gpsarkar / esmodules
Created September 18, 2023 16:02
esmodules
https://sokra.github.io/interop-test/
@gpsarkar
gpsarkar / tsconfig-options.md
Created September 11, 2023 02:18
tsconfig options

Important and Most Used:

  1. compilerOptions:

    • This section contains various options for controlling TypeScript compilation.
      • target: Specifies the ECMAScript target version (e.g., ES5, ES6, etc.).
      • module: Specifies the module system (e.g., CommonJS, ES6, etc.).
      • strict: Enables strict type checking options.
      • esModuleInterop: Ensures compatibility between CommonJS and ES module imports.
  2. include:

@gpsarkar
gpsarkar / gist:b0b403331ced06a5d4cd4aa08dd0e395
Created February 21, 2023 13:25
run github action for a separate branch
### Create an action like this
------
name: ACTION NAME
on:
workflow_dispatch:
### install github cli
@gpsarkar
gpsarkar / gist:a86ad83d73c7306caeacda3e85e082c5
Last active January 15, 2023 07:39
init frontend project
yarn init -y
yarn add normalize-scss
yarn add --dev stylelint stylelint-config-sass-guidelines stylelint-config-prettier stylelint-prettier prettier
yarn add --dev husky lint-staged
.stylelintrc.json
{
@gpsarkar
gpsarkar / launch.json
Created May 14, 2022 08:54
Launch.json to debug mocha tests in vs code
{
"configurations": [
{
"args": [
"${workspaceFolder}/spec/*.spec.js",
"--require",
"@babel/register"
],
"internalConsoleOptions": "openOnSessionStart",
"name": "Mocha Tests",
# Install
Download win 64 bit from https://www.rust-lang.org/tools/install
### Run the installer. It will launch a command prompt
The Cargo home directory located at:
C:\Users\gs\.cargo
@gpsarkar
gpsarkar / gist:fac4128c925e3c2de4c5e70884aa78fd
Last active August 29, 2021 20:31
azure powershell notes
// get ps version
Get-Host | Select-Object Version
$PSVersionTable.PSVersion
// get azure powershell version
Get-Module -ListAvailable -Name Az
Get-Module -ListAvailable -Name Azure -Refresh
// get apim services
@gpsarkar
gpsarkar / gist:a7c593c91668f56c8e493d2eb490adab
Created August 24, 2021 17:58
update all packages in package.json
npx npm-check-updates -u --timeout 120000
npm install