Skip to content

Instantly share code, notes, and snippets.

View rjoydip-zz's full-sized avatar
💭
👨‍💻

Joydip Roy rjoydip-zz

💭
👨‍💻
View GitHub Profile
@rjoydip-zz
rjoydip-zz / javascript-interview-questions.js
Last active August 4, 2022 04:13
Interview Question By Interviewer
/**
* @name - JavaScript Interview questions
*/
//====
/**
* @name - TypeOf
* @description - typeof [Number]
*/
console.log(typeof 25 === "number");
console.log(typeof 3.14 === "number");
@rjoydip-zz
rjoydip-zz / terminal-output-extract.sh
Created May 8, 2021 05:47
Extract terminal output and create a log file
#!/bin/sh
npm start | while IFS= read -r line; do printf '%s %s\n' "[$(date "+%Y-%m-%d %H:%M:%S")]" "$line"; done >>/log/logger.log
@rjoydip-zz
rjoydip-zz / snap-install-dev-soft-list.md
Last active August 11, 2020 05:24
List of software which needs to install through snap

Application

  • Postman - sudo snap install postman

IDE

  • Atom - sudo snap install atom --classic
  • VSCode - sudo snap install code --classic
  • Android Studio - sudo snap install android-studio --classic
  • Eclipse - sudo snap install eclipse --classic
@rjoydip-zz
rjoydip-zz / neno-echo.md
Created July 16, 2020 17:23
echo a string in neon (rust & node)

echo a string in neon (rust & node)

The new method on JsString class takes a &str so we add a & before the name of the variable:

use neon::prelude::*;
use neon::register_module;

fn echo(mut cx: FunctionContext) -> JsResult<JsString> {
let my_str = cx.argument::(0)?.value() as String;
@rjoydip-zz
rjoydip-zz / ubuntu_devenv.sh
Last active June 20, 2020 08:59 — forked from esavard/ubuntu_devenv.sh
Ubuntu post installation script that setup a development environment using dialogs
#!/usr/bin/bash
failure() {
printf "\n%s\n" ""
exit 2
}
#***********************************
# CREATE TEMPORARY FOLDER
#***********************************
@rjoydip-zz
rjoydip-zz / example_one.ts
Last active June 4, 2020 13:40
Issue on statSync while importing
function hasEnv(): boolean {
try {
return Deno.statSync(".env").isFile;
} catch (_) {
return false;
}
}
async function createEnv(): Promise<void> {
const dockerenv = await Deno.open(".env", {
@rjoydip-zz
rjoydip-zz / settings.md
Created March 17, 2019 10:01
initial vscode settings

Initial vscode settings.json

"explorer.confirmDelete": false,
"editor.minimap.enabled": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"window.zoomLevel": 1
@rjoydip-zz
rjoydip-zz / github-ssh-keygen-on-windows.md
Created October 17, 2018 09:34
github-ssh-keygen-on-windows

How to generate ssh key and configure it in github on windows

Please folow below steps carefully.

Steps

  • Open your bash terminal
  • Type ssh-keygen -o
  • Follow ssh keygen setps
  • Go to /c/Users//.ssh
@rjoydip-zz
rjoydip-zz / UV_THREADPOOL_SIZE.md
Last active January 5, 2024 13:08
How you can set `UV_THREADPOOL_SIZE` value?

When you need to set value to "UV_THREADPOOL_SIZE"?

  • Libuv has a default thread pool size of 4, and uses a queue to manage access to the thread pool - the upshot is that if you have 5 long-running DB queries all going at the same time, one of them (and any other asynchronous action that relies on the thread pool) will be waiting for those queries to finish before they even get started.

  • Note, however, that tuning UV_THREADPOOL_SIZE may make more sense for a standalone application like a CLI written in Node.js. If you are standing up a bunch of Node.js processes using the cluster module then I would be surprised if tuning UV_THREADPOOL_SIZE was particularly beneficial for you. But if your application resembles the web tooling benchmarks then tuning UV_THREADPOOL_SIZE may help with performance.

@rjoydip-zz
rjoydip-zz / test_all_keys_using_chai.md
Last active March 17, 2019 09:55
test all keys of an array object

Test all keys of an array object using mocha, chai, chai-things.

Helper library

Chai Things

Note: Don't forgot to use chai.use(require('chai-things'));

Example: