Running shell commands from a Node application

Running shell commands in your node application: Found great explanation here, The Child Process Module When we execute shell commands, we are running code outside of our Node.js application. In order to do this, we need to run these commands in a child process. A child process is code that is run in a different thread (and process id) outside your Node.js application. However, we can still send and receive information from the child process using standard I/O streams....

September 15, 2022 · 2 min · Anant

Git - Update Local Branch With Clean Copy of Remote branch

How to update 1 branch local (say A) - to match exactly the remote branch A If you have any commits made locally, remove them - match the remote branch A. Any untracked files also remove. develop branch is an example case of A - I always try to keep my local develop branch matching to remote because I never do commits directly to develop branch locally apart from updating local develop to match remote develop....

July 12, 2022 · 1 min · Anant

Quickly check - Disk Size on your Windows machine

Apart from diskmgmt.msc On cmd: wmic diskdrive get size C:\Users\Anant>wmic diskdrive get size Size 256052966400 Above shows ~ 256 GB 256,052,966,400 Same on diskmgnt.msc :

June 29, 2022 · 1 min · Anant

Day11 #100DaysOfCode

To begin with, To begin, obtain OAuth 2.0 client credentials from the Google API Console Got this from below: Google Documentation https://developers.google.com/identity/protocols/oauth2 Configuration https://console.developers.google.com/apis/credentials Then your client application requests an access token from the Google Authorization Server, extracts a token from the response, and sends the token to the Google API that you want to access. Same steps in detail: given here: https://developers.google.com/identity/protocols/oauth2 New Project: on same page, asks for Authorized redirect URI...

May 30, 2022 · 1 min · Anant

Day10 #100DaysOfCode (Next app Part 2)

Continuing the 100doc challenge, although with a break 😜 Read Part 1 here. Submit the ‘message sent to a user’ to DB, by username How to fetch promise version async await version https://rapidapi.com/guides/fetch-api-async-await Dont forget to add req body! in client: in /[username].js function addNoteHandler(noteData) { //console.log(`in [username], got noteData: ${JSON.stringify(noteData)}`); //submit to DB API fetch("/api/add-note", { method: "POST", body: JSON.stringify({ test: "test" }), // Adding headers to the request. It is actually optiona here....

May 28, 2022 · 3 min · Anant