Skip to content

Instantly share code, notes, and snippets.

View gauravkrp's full-sized avatar
🏠
Working from home

Gaurav Pandey gauravkrp

🏠
Working from home
View GitHub Profile
@gauravkrp
gauravkrp / run multiple Redis instances on Ubuntu 20.04.md
Created November 25, 2022 14:39 — forked from bakar-io/run multiple Redis instances on Ubuntu 20.04.md
How to run multiple Redis instances on Ubuntu 20.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
import { useEffect, useState } from 'react';
import { Flex, Select, Box, Text, Input, Spinner, Icon, Button } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { MdCancel } from 'react-icons/md';
import Image from 'next/image';
import { filterData, getFilterValues } from '../utils/filterData';
import { baseUrl, fetchApi } from '../utils/fetchApi';
import noresult from '../assets/images/noresult.svg';
@gauravkrp
gauravkrp / aa_enums.js
Last active February 2, 2022 12:42
all enums and constants being used in AA APIs
/**
* Lists out all enums and constants being used in AA APIs
* Taken from RBI AA Specs at https://swagger-ui.rebit.org.in/?url=https://specifications.rebit.org.in/api_specifications/account_aggregator/AA_1_1_3.yaml#/
* Author: Gaurav | https://github.com/gauravkrp
* Last Updated on : 02 Oct, 2021
*/
export const CONSENT_MODE = {
VIEW: 'VIEW',
STORE: 'STORE',
@gauravkrp
gauravkrp / remove-wp-plugin-update-notofication.php
Last active January 22, 2021 15:41
Remove WordPress update notice for forked/nulled plugins
/**
* Add the following piece of code to themes functions.php file or include there it as a file.
* remove wordpress update notice for forked/nulled plugins
*/
function remove_update_notifications( $value ) {
if ( isset( $value ) && is_object( $value ) ) {
unset( $value->response[ 'advanced-custom-fields-pro/acf.php' ] );
}
@gauravkrp
gauravkrp / checkIfImageExists.ts
Created September 23, 2020 06:35
JS - Check if image exists
export default (imgPath: string) => {
return new Promise(resolve => {
const img = new Image();
img.src = imgPath;
img.onload = () => resolve(true);
img.onerror = () => resolve(false);
});
};
@gauravkrp
gauravkrp / country_dial_info.json
Created June 7, 2020 12:07 — forked from DmytroLisitsyn/country_dial_info.json
A JSON dataset of entities containing country name, code, dial (phone) code and flag emoji icon.
[{"name":"Afghanistan","flag":"🇦🇫","code":"AF","dial_code":"+93"},{"name":"Åland Islands","flag":"🇦🇽","code":"AX","dial_code":"+358"},{"name":"Albania","flag":"🇦🇱","code":"AL","dial_code":"+355"},{"name":"Algeria","flag":"🇩🇿","code":"DZ","dial_code":"+213"},{"name":"American Samoa","flag":"🇦🇸","code":"AS","dial_code":"+1684"},{"name":"Andorra","flag":"🇦🇩","code":"AD","dial_code":"+376"},{"name":"Angola","flag":"🇦🇴","code":"AO","dial_code":"+244"},{"name":"Anguilla","flag":"🇦🇮","code":"AI","dial_code":"+1264"},{"name":"Antarctica","flag":"🇦🇶","code":"AQ","dial_code":"+672"},{"name":"Antigua and Barbuda","flag":"🇦🇬","code":"AG","dial_code":"+1268"},{"name":"Argentina","flag":"🇦🇷","code":"AR","dial_code":"+54"},{"name":"Armenia","flag":"🇦🇲","code":"AM","dial_code":"+374"},{"name":"Aruba","flag":"🇦🇼","code":"AW","dial_code":"+297"},{"name":"Australia","flag":"🇦🇺","code":"AU","dial_code":"+61"},{"name":"Austria","flag":"🇦🇹","code":"AT","dial_code":"+43"},{"name":"Azerbaijan","flag":"🇦🇿","code":"AZ","dial_code":"+9