Skip to content

Instantly share code, notes, and snippets.

View KiranMantha's full-sized avatar
🎯
Focusing on PlumeJS

Kiran Mantha KiranMantha

🎯
Focusing on PlumeJS
View GitHub Profile
@KiranMantha
KiranMantha / copyHtmlTableForExcel.js
Created January 6, 2025 14:04 — forked from drodsou/copyHtmlTableForExcel.js
Copy HTML table to clipboard, for pasting in Excel (javascript)
// In Excel make sure to have this option enabled: Home / Clipboard / Options / Collect without showing the Office clipboard
// Tested in Windows 10 only
let table = document.querySelector('#table').outerHTML;
table = table
.replaceAll('\n','<br style="mso-data-placement:same-cell;"/>') // new lines inside html cells => Alt+Enter in Excel
.replaceAll('<td','<td style="vertical-align: top;"'); // align top
navigator.clipboard.writeText(table).then(
()=>console.log("success"),
(e)=>console.log("error", e),
@KiranMantha
KiranMantha / Dockerfile
Created May 12, 2024 04:27 — forked from micalevisk/Dockerfile
Production Dockerfile example for NestJS projects.
## ===========================================================> The common stage
FROM node:16.14 AS base
ENV NODE_ENV=production
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
## Remove unnecessary files from `node_modules` directory
@KiranMantha
KiranMantha / kafka.md
Last active May 10, 2024 06:32 — forked from kim-hyunjin/kafka.md
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper

@KiranMantha
KiranMantha / jest-with-esm.md
Last active March 5, 2024 09:50 — forked from rstacruz/README.md
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

/** My comments -taw -- Source location of this script: https://gist.github.com/taw00/1c014549dd649c597518e6eb4f1e3969
* To use in Google Sheets:
* - Open or create Google Spreadsheet
* - Click on Tools -> Script Editor
* - Click Create script for Spreadsheet
* - Delete the placeholder content and paste the code from this script
* - Click the save button and give the project a name
* - Back in the spreadsheet, in a cell, you can type “=ImportJSON()” and begin filling out it’s parameters.
* Original developer:
* - http://blog.fastfedora.com/projects/import-json