Skip to content

Instantly share code, notes, and snippets.

View 19sajib's full-sized avatar
🤒
Out sick

Md Abu Bakkar Siddiqe Sajib 19sajib

🤒
Out sick
View GitHub Profile
@19sajib
19sajib / revert-a-commit.md
Created September 24, 2022 16:36 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@19sajib
19sajib / GraphQL Interview Questions.md
Last active July 27, 2022 12:01
18 GraphQL Interview Questions

GraphQL

Q1: What is GraphQL?

Answer: GraphQL is a query language created by Facebook in 2012 which provides a common interface between the client and the server for data fetching and manipulations.

The client asks for various data from the GraphQL server via queries. The response format is described in the query and defined by the client instead of the server: they are called client‐specified queries. The structure of the data is not hardcoded as in traditional REST APIs - this makes retrieving data from the server more efficient for the client.

@19sajib
19sajib / web3IQ.md
Last active July 26, 2022 17:21
Web3 Interview Questions

What is Web3?

Ans: Web3 is an idea for a new iteration of the World Wide Web which incorporates concepts such as decentralization, blockchain technologies, and token-based economics.

What is the difference between Web2 and Web3?

Ans: Web 2.0 is the current version of the web with which we are all familiar, while Web 3.0 represents its next phase, which will be decentralized, open, and of greater utility.

What is the difference between Proof of Work (PoW) and Proof of Stake (PoS)?

Ans: Proof of Stake (POS) uses randomly selected miners to validate transactions. Proof of Work (POW) uses a competitive validation method to confirm transactions and add new blocks to the blockchain.

Proof of work is a competition between miners to solve cryptographic puzzles and validate transaction in order to earn block rewards.

@19sajib
19sajib / NodeJs Interview Questions.md
Last active July 4, 2022 04:04
NodeJs Interview Questions

What is Node.js?

Node.js is an open-source, cross-platform Javascript runtime environment and libary for running web applications outside the client's browser. It is used for creating server-side web applications. Node.js is perfect for data-intensive applications as it uses an asynchronous, event-driven model.

How Node.js works?

Node.js is based on V8 engine, it is a virtual machine that utilizes JavaScript as its scripting language and achives high output via non-blocking I/O and single threaded event loop.

@19sajib
19sajib / GitDeleteCommands.ps1
Created June 30, 2022 12:46 — forked from cmatskas/GitDeleteCommands.ps1
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch
@19sajib
19sajib / Common MongoDB Query.md
Created June 30, 2022 12:45
Common MongoDB Query

MongoDB

// Connecting to mongoDB mongoose.connect(CONNECTION_URL,

{ useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false, },