Skip to content

Instantly share code, notes, and snippets.

View rajeshkumaravel's full-sized avatar
🎯
Focusing

Rajesh Kumaravel rajeshkumaravel

🎯
Focusing
View GitHub Profile
@rajeshkumaravel
rajeshkumaravel / memorySizeOfObject.js
Created July 11, 2022 11:26
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@rajeshkumaravel
rajeshkumaravel / nvm_windows.md
Last active December 7, 2022 13:18
Installing NodeJS thru NVM in Windows (Without Admin)

************ UNINSTALL ANY PREVIOUS NVM AND NODEJS ************

1. Open Powershell and Execute following command

cd $Env:USERPROFILE;
Invoke-WebRequest https://raw.githubusercontent.com/jchip/nvm/v1.5.4/install.ps1 -OutFile install.ps1;
.\install.ps1 -nvmhome $Env:USERPROFILE\nvm;
del install.ps1
@rajeshkumaravel
rajeshkumaravel / getAllImports.ts
Created February 16, 2023 06:40 — forked from tinovyatkin/getAllImports.ts
Getting all imported modules names from a JS file using TypeScript parser
import { readFileSync } from 'fs';
import { builtinModules } from 'module';
import ts from 'typescript';
const tsHost = ts.createCompilerHost(
{
allowJs: true,
noEmit: true,
isolatedModules: true,
@rajeshkumaravel
rajeshkumaravel / node-setup.bat
Created March 20, 2023 08:53 — forked from manuelbieh/node-setup.bat
Install node.js + some packages on Windows via Batchfile
@echo off
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo This setup needs admin permissions. Please run this file as admin.
pause
exit
)
set NODE_VER=null
@rajeshkumaravel
rajeshkumaravel / install-git.bat
Created March 20, 2023 08:54 — forked from patmigliaccio/install-git.bat
Quick install Git for Windows with batch script. Include the git*.exe install executable in the same directory as this script.
:: Copyright (C): 2017 Pat Migliaccio
:: pat@patmigliaccio.com
::
:: LICENSE: MIT
::
:: File: install-git.bat
::
:: Batch file for a quick install of Git for Windows
:: Include the git*.exe install executable
:: in the same directory as this script.
@rajeshkumaravel
rajeshkumaravel / steps.md
Created December 7, 2023 13:38
Installing a Font in WSL (Windows Subsystem for Linux)

Installing a Font in WSL (Windows Subsystem for Linux)

To install a font in WSL, follow these steps:

  1. Check Font Location: Confirm that the font file (e.g., VictorMono.ttf) is located in a directory accessible from your WSL instance. You can copy the font file to your WSL home directory for simplicity.

  2. Install Font: You can use the fc-cache command to update the font cache in WSL and make the font available. Open a terminal in your WSL instance and run the following commands:

sudo cp /mnt/c/path/to/VictorMono.ttf /usr/local/share/fonts/