Skip to content

Instantly share code, notes, and snippets.

View gpsarkar's full-sized avatar
💭
🚀

Ganapati Sarkar gpsarkar

💭
🚀
View GitHub Profile
@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
Javascript
-----------------
https://github.com/systemjs/systemjs
SystemJS is a hookable, standards-based module loader. It provides a workflow where code written for production workflows of native ES modules in browsers (like Rollup code-splitting builds), can be transpiled to the System.register module format to work in older browsers that don't support native modules, running almost-native module speeds while supporting top-level await, dynamic import, circular references and live bindings, import.meta.url, module types, import maps, integrity and Content Security Policy with compatibility in older browsers back to IE11.