Skip to content

Instantly share code, notes, and snippets.

View isamrish's full-sized avatar
:octocat:
building useful stuffs

Amrish Kushwaha isamrish

:octocat:
building useful stuffs
View GitHub Profile
@isamrish
isamrish / performance-of-map.csv
Created June 24, 2023 07:37
Performance observation of map method
maxLength/Observation Observation1 Observation2 Observation3 Observation4 Observation5
10000 0.10000000149011612 0 0 1 0
1000000 105.89999999850988 107.80000000447035 106.29999999701977 109.20000000298023 113.80000000447035
1000000000 16266 16299.79999999702 16280.60000000149 16351.29999999702 16302.39999999851
@isamrish
isamrish / performance-of-foreach.csv
Created June 24, 2023 07:06
Performance Observation of forEach method
maxLength/Observation Observation1 Observation2 Observation3 Observation4 Observation5
10000 0.10000000149011612 0.10000000149011612 0.10000000149011612 0 0.10000000149011612
1000000 63.399999998509884 60.100000001490116 58.79999999701977 58.30000000447035 59.5
1000000000 16662.20000000298 16721.30000000447 16679.70000000298 16695.10000000149 16699.89999999851
@isamrish
isamrish / performance-for-loop.csv
Last active June 24, 2023 05:07
Performance Observation of for loop
maxLength/Observation Observation1 Observation2 Observation3 Observation4 Observation5
10000 0.20000000298023224 0.09999999403953552 0.20000000298023224 0.09999999403953552 0.20000000298023224
1000000 22.700000002980232 22.5 22.5 22.399999998509884 22.200000002980232
1000000000 1774.6000000014901 1812.3999999985099 1775.2000000029802 1803.2999999970198 1776.1000000014901
@isamrish
isamrish / js.md
Created June 23, 2021 15:29
JavaScript

Create an array of number (0 to n)

Array.from(Array(n+1).keys())

OR with spread operator

[...Array(n+1).keys()]
@isamrish
isamrish / mongodb-in-docker.md
Last active February 14, 2021 19:45
Install MongoDB in mac os - ( especially Big Sur)

MongoDB in docker

Install mongodb image from docker

docker run  -p 8000:27017 --name mongodb-name -d mongo:3.6

Install mongo shell in your system locally

@isamrish
isamrish / docker.md
Last active October 13, 2020 07:26
Docker knowledge for Front End Devs

Docker knowledge for Front End Devs 😀

✍️ Build a docker image using Dockerfile

First go to the root folder where Dockerfile exists and then build docker image

docker build -t dockerimage:tag1 .

e.g. =>

@isamrish
isamrish / Javascript-Projects.md
Last active October 1, 2020 10:06
Create your js project from scratch

Things which you should consider for JavaScript project

1. Editor and Config

  • .editorconfig

2. Package Management

  • npm
  • yarn

The naming convention follows this pattern:

.block {}
.block__element {}
.block--modifier {}

.block represents the higher level of an abstraction or component. .block__element represents a descendent of .block that helps form .block as a whole.

@isamrish
isamrish / trackRemoteBranch.md
Last active February 4, 2020 10:06
How to track remote branch to locally

If you have created a branch remotely , you can track it to your local environment by running this command

git checkout --track origin/branch-name

For Example, If the remote branch name is bug-fix, then command will be

git checkout --track origin/bug-fix
@isamrish
isamrish / singleUserInGhost.json
Last active January 23, 2020 17:55
Minimal JSON file for adding a single user in a ghost environment.
{
"data": {
"users": [
{
"email": "sample@gmail.com",
"name": "sample"
}
]
},
"meta": {