sahilrajput.com

Edit this page

Sahil Rajput

Crazy Spirit, Namer, Live in heart, Dangerously insatiable curiosity
Exercise Routines, Dhyaan/Meditation, Music & Visuals, Blog Recommendations, Thoughts & Principles (md), Lifestyle, Celebration by Simplebeing
Vocab Doc (Fast🚀, iframe, Debug), ❤️ Book Recommendations, svelte.monktechnoworld.com, Glass Thoughts, Help me grow feedback
JS CheatSheet, MacOS Vscode Shortcuts, Unit Conversions, Transcribe/Convert/Download, English/Hindi Typing Courses, ⭐️Short Links
Website: sahilrajput.com
Github: github.com/sahilrajput03/sahilrajput03
Android App: Tech Blog by Sahil Rajput
❤️YouTube Playlists: youtube.com/@sahilrajput03/playlists



☁️ VPS vs. 🔌 Raspberrypi

VPS (Virtual Private Server) means Linode, AWS, Azure, GCP etc.

Why VPS over Raspberry pi?

  1. Raspberry pi needs re-installation of OS if linux gets messed up.
  2. Raspberry pi needs additional installation of docker/k3s
  3. Raspberry pi needs to be handled over broadband (router settings) via port forwarding to make it accessible over internet.
  4. Raspberry pi would need static ip (monthly paid) or any other no-ip service to make the dynamic ip actually work for any project to work over longer duration of times.
  5. Raspberry pi would need to be setuped for access over ssh.
  6. Raspberry pi is strictly dependent on factors like:
    • internet conectivity over broadband
    • electricity on site
  7. No fucking wires.

Why raspberry pi over VPS?

  1. Cheaper in cost i.e., you would save cost around 8-10 thousand probably as if it were hosted on aws as you can host multiple applications on 8GB raspberry pi.

📑 Why Google Docs over any other publishing tools

I prefer making notes in Google Doc rather than in markdown or any other software like notion, medium, substack, wordpress blog, bogger (from Google) etc because I am very much satified by the features provided by Google Doc and I already know how to use Google Doc (WYSIWYG):

Below are some features of Google Doc that you might helpful too:

  1. Notes are about more about note making experience than to refer notes. In Google Docs the experience of notes making is awesome.
  2. give people exclusive acces using email for read or write permissions
  3. Can be published to web via direct link using “Publish to web” feature. You can find it here “File > Share feature > Publish to web”.
  4. Can be embedded in websites, this is particularly useful when you want some content to be automatically updated which is present in a google document. This could be really helpful thing particularly for non coders. You can get the embed code for the document by going to “File > Share feature > Embed”. Here is an example which you can check and you can actually view the source code of the html page via option + cmd + u (macos) or ctrl + u (on mac/linux).
  5. Faster editing process than markdown.
  6. Better editing experience than markdown.
  7. There is syntax language to be learned if you use markdown.
  8. Google Doc is editable on Google Doc with awesome experience.

🚀 If still you want to use markdown — prefer these tools as they help to edit markdown with WYSWYG (What you see is what you get) way:

  1. Obsidian
  2. Typora
  3. VS Code’s Edit with live preview: [NOTE: This is very buggy experience as of now 28 May 2025.]

🥕🍎 In command ts-node-dev --transpile-only tg.ts what does the flag do --transpile-only? (ChatGPT)

The --transpile-only flag in the ts-node-dev command tells TypeScript Node (ts-node) to skip type checking when running the TypeScript code. Normally, TypeScript checks the types as it compiles the code, which can slow down the process.

When using --transpile-only, TypeScript only transpiles the code (i.e., converts TypeScript to JavaScript) without performing any type checks. This can make the development process faster, especially in situations where you rely on external tools (like an IDE or a separate build step) to handle type checking.


ॐ सर्वे भवन्तु सुखिनः			Om Sarve Bhavantu Sukhinah)			- Om, May All be Happy,
सर्वे सन्तु निरामयाः । 			Sarve Santu Niraamayaah) 			- May All be Free from Illness.
सर्वे भद्राणि पश्यन्तु 			Sarve Bhadraanni Pashyantu)			- May All See what is Auspicious,
मा कश्चिद्दुःखभाग्भवेत् । 		Maa Kashcid-Duhkha-Bhaag-Bhavet)		- May no one Suffer.
ॐ शान्तिः शान्तिः शान्तिः ॥ 		Om Shaantih Shaantih Shaantih)			- Om Peace, Peace, Peace.
echo Hello world! > /dev/null
cat /dev/null
!!(() => {})

Text Better

Some profound reasons why to text better?

How to text better and avoid confusion:

Javascript Cheatsheet - Sahil

SLEEP FUNCTION
==============
await new Promise(r => setTimeout(r, 2000))


SLICE Array Method
==================
// Note:
// 1. slice() method returns shallow copied array.
// 2. first argument is inclusive and second argument is **non-inclusive**
const newArray = myArray.slice(startIdx, endIdx + 1);



SORTING Array Method
=======
myNumbers.sort(); // sorts in ascending order [DEFAULT]
myNumbers.sort((a, b) => a - b); // sorts in ascending order [DEFAULT]
myNumbers.sort((a, b) => b - a); // sorts in descending order



REDUCE ARRAY METHOD
======
ar = [ 1, 2, 3 ]
ar.reduce((a,b) => a+b, 0) // Output: 6



PUSH/POP/SHIFT/UNSHIFT - all mutate array
=====
`push` and `pop` works on end of array
`unshift` and `shift` works on start of array



USING FETCH
===========
// client-side
const response = await fetch('/roll'); // 'GET'
const { number } = await response.json();

const response = await fetch('/todo', {
	method: 'POST', // 'PUT', 'DELETE', 'PATCH'
	body: JSON.stringify({ description }),
	headers: {
		'Content-Type': 'application/json'
	}
});
const { description } = await response.json();

// server-side
const { description } = await request.json();



GETTER AND SETTERS IN AN OBJECT
===============================
// Example 1:
const obj = {
    countValue: 42,
    get count() {
        return this.countValue;
    },
    set count(value) {
        this.countValue = value;
    }
};

console.log(obj.count); // 42
obj.count = 43;
console.log(obj.count); // 43




// Example 2:
let input = {
    a: 1,
    b: 2,
    get sum() {
        return input.a + input.b;

    }
};

console.log(input.sum); // 3

input.a = 3;
input.b = 4;
console.log(input.sum); // 7




// Example 3:
function add(input) {
    return {
        get value() {
            return input.a + input.b;

        }
    };
}

let input = { a: 1, b: 2 };

let total = add(input);
console.log(total.value); // 3

input.a = 3;
input.b = 4;
console.log(total.value); //7




// WHEREAS FUNCTION DEFINED WITH `function` KEYWORD OR ARROW-FUNCTION-SYNTAX BEHAVES HAS GENERAL FUNCTIONS UNLIKE GETTER/SETTERS:
// -----------------------------------------------------------------------------------------------------------------------------
// Read more differenes here - https://github.com/sahilrajput03/sahilrajput03/blob/main/learn-js.md#geeter-setters-in-object
const obj = {
  countValue: 42,
  count: () => this.countValue, // Note: `this` here doesn't refer to the object.
};

console.log(obj.count()); // undefined, because `this` does not refer to `obj`.



~~
===============================
// In JS, the ~~ symbol is often referred to as the double tilde. It is a shorthand trick for converting a number to an integer by dropping its decimal part (similar to Math.floor() for positive numbers). ~~ relies on bitwise operations, which are implemented at a lower level in JavaScript. Using ~~ is limited to 32-bit signed integers. For usage with any numeric value please prefer using `Math.trunc()` instead. (from ChatGPT)
console.log(~~4.5);    // Output: 4
console.log(~~-4.5);   // Output: -4

Online Markets I use:

Public Clipboard: Click here

Superscript Numbers: ⁰¹²³⁴⁵⁶⁷⁸⁹

Unit Conversions

Tags: #metre, #foot, #feet, #centimeter

A small scale is 15cm long.

Length 			
======
1 ft ≈ 30.48 cm
1 m ≈ 3.3 ft (precisely 3.28084)
1 m ≈ 39.4 inch (precisely 39.3701)
1 km ≈ 0.62 miles (precisely 0.621371)
1 mile ≈ 1.61 km (precisely 1.60934)

10^⁶ = 1 Million = 10 Lakh
10^⁹ = 1 Billion = 100 Crore
10^¹² = 1 Trillion = 100k Crore  =  100 Thousand Crore  =  1 Lakh Crore

Mass
====
1 kg ≈ 2.2 lbs (pounds)
1 lbs ≈ 0.45 kg

Currency
========
**For fastest conversion from dollar to inr you can simply multiply by 100 (~84 ₹/$).**

$ to ₹ Conversion factor: 83 ₹/$
₹ to $ Conversion factor: 0.012 $/₹

$ 1 Million  = ₹ 8.3 Crore
$ 1 Billion  = ₹ 8.3k Crore
$ 1 Trillion = ₹ 83 Lakh Crore = ₹ 8300k Crore

Conversion Trick For $ and ₹
============================
1. To convert $ to ₹ we can multiply the value with 10 and 8 in sequence. (Refer ^1 at bottom)
2. To convert ₹ to $ we can divide the value with 10 and 8 in sequence (Refer ^1 at bottom)

References
==========
^1: 10 and 8.3 are multiplicative factors of 83 because 10 x 8.3 equals 83.

What is Selling?

Source: Click here

PEU:

Royal Society Prizes for Science Books

Breath by James Nestor is the finalist for the year 2021.

Click here

Breathing Videos by James Nestor

❤️ Breathing Videos: Click here

❤️ Interesting Page of James Nestor - Wikipedia: Click here

Document Order & Titles Notice for Google Docs

social-media-game

Superprof .co.in: Click here

Indiamart .com: Click here

English and Hindi Typing Courses

Note: Mangal is part of the Unicode standard, which means it supports a wide range of Devanagari characters and is more compatible with modern software and devices.

❤️ Note: Learn Typing on Mobile: Click here)

Proxy Sites of Torrent Sites

Source: Click here (earlier sitenable.com)

Tech Journal & Blogging: Click here | Old feed

General Blogging: Click here

English Channels in India

Source: List of English-language television channels in India | Wikipedia: Click here

Trademarks: OneUniverse, Same Roof

Sahil’s Vocabulary 🚶: Click here | Doc

Transcribe, Convert, Download

❤️ 🫁 Reset Immune System - Wim Hof Method & Breathwork (Doc)

Note: Wim Hof Breathing or Breathe With Sandy are modern versions of Tummo Breathing.

Practices

*bc = breath cycle

Why Wim Hoff breathing?

It’s gonna boost both your immune system and calmness in a compound effect each day throughout life.

Business Apps

Depressions & Mental Health Support

Be Productive with videos 📽️ 🎬

Original & Curated Articles

Continents

Source: Continent - Wikipedia: Click here

Quick Links:

More:

References:

Comparison of kramdown attribute markup vs. plain html markup: Both looks equally good to me.
- Learn `tiged` (alternate of degit): [Click here](https://docs.google.com/document/d/1IEAkO2rUKV-fwVI4_6cqVuHvQq0zKkJyTmgKDa89WQo/edit?tab=t.0){: search-title="Learn `tiged` (alternate of degit)"}
- Learn `tiged` (alternate of degit): <a href="https://docs.google.com/document/d/1IEAkO2rUKV-fwVI4_6cqVuHvQq0zKkJyTmgKDa89WQo/edit?tab=t.0" search-title="Learn `tiged` (alternate of degit) (uses a tag)">Click here</a>

Made using Jekyll Template - abhinavs/moonwalk

Note to Sahil: Search Index done from bottom till “Learn React Native” link (moving upwards).

Note to Sahil: kramdown to anchor tags (html) done from bottom till “Learn macOS - Samaksh” link (moving upwards).


NOTE: For files ending with .md (e.g., searh for ./learn-js.md) are not direct links to github repository’s page links. The plan is to render this page totally as html markup inside the svelte component near future and not make use of markdown (markdown to html converstaion) at all thus I will be able to leverage all facilities of modern svelte development framework. ❤️