Skip to content

Instantly share code, notes, and snippets.

View ankit-kumar-jat's full-sized avatar
🎯
Focusing

ankit kumar jat ankit-kumar-jat

🎯
Focusing
View GitHub Profile
@ankit-kumar-jat
ankit-kumar-jat / package-lock-conflicts.md
Created August 29, 2024 10:39 — forked from szemate/package-lock-conflicts.md
How to resolve package-lock.json conflicts

How to resolve package-lock.json conflicts

It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

  1. Update the master branch with the latest changes:
    git checkout master
    git pull
    
  2. Merge your feature branch into master:
@ankit-kumar-jat
ankit-kumar-jat / sassas.md
Created September 5, 2022 17:31 — forked from AdamMarsden/sassas.md
Sass Architecture Structure

Sass Architecture Structure

sass/
|
|– base/
|   |– _reset.scss       # Reset/normalize
|   |– _typography.scss  # Typography rules
|   ...                  # Etc…
|
@ankit-kumar-jat
ankit-kumar-jat / load-script.js
Created August 31, 2022 10:08
Load javascript file dynamically
/**
*
* @param {String} url scrip url
* @param {String} id id for script tag
* @returns promise
*/
const loadScript = (url, id) => {
return new Promise((resolve) => {
const existingScript = document.getElementById(id);
if (existingScript) resolve(true);
@ankit-kumar-jat
ankit-kumar-jat / axiosBaseQuery.js
Last active June 15, 2023 18:10
Axios Base Query for RTK Query (redux toolkit)
import axios from 'axios'
export const axiosBaseQuery =
({ baseUrl, prepareHeaders }) => {
return async ({ url, method, body: data, params, ...rest }, api) => {
try {
// this to allow prepare headers
if (prepareHeaders) {
axios.interceptors.request.use(function (config) {
@ankit-kumar-jat
ankit-kumar-jat / roles_invesitgation.md
Created May 27, 2022 03:20 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
@ankit-kumar-jat
ankit-kumar-jat / nginx-tuning.md
Created October 4, 2021 06:29 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@ankit-kumar-jat
ankit-kumar-jat / sw.js
Created December 1, 2020 08:53 — forked from DannyMoerkerke/sw.js
Full-fledged service worker which caches API requests and responses using IndexedDB
const version = 1;
const cacheName = `our_awesome_cache`
// the static files we want to cache
const staticFiles = [
'index.html',
'src/css/styles.css',
'src/img/logo.png',
'src/js/app.js'
];