This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
const { exec } = require("child_process"); | |
async function main(){ | |
const districts = [ | |
{ district_id: 294, district_name: 'BBMP' }, | |
{ district_id: 265, district_name: 'Bangalore Urban' }, | |
{ district_id: 276, district_name: 'Bangalore Rural' }, | |
// { district_id: 363, district_name: "Pune" }, | |
// { district_id: 270, district_name: 'Bagalkot' }, | |
// { district_id: 264, district_name: 'Belgaum' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from "react"; | |
import useSWR, { ConfigInterface, keyInterface } from "swr"; | |
import { fetcherFn } from "swr/dist/types"; | |
export const useLazySWR = <T, U>( | |
key: keyInterface, | |
fn?: fetcherFn<T>, | |
config?: ConfigInterface<T, U> | |
) => { | |
const [shouldFetch, setShouldFetch] = useState(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_request_hash($query, $vars) | |
{ | |
return md5($query . json_encode($vars)); | |
} | |
function should_cache($query, $op, $vars) | |
{ | |
global $wp_object_cache; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: bootstrap.sh <username>" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Print before executing (so we can know which commands take how long) | |
set -x | |
if [ $# -ne 3 ]; then | |
echo Usage: fix-web-permissions.sh webserver-group username /root/web/dir | |
echo Eg: fix-web-permissions.sh www-data deepak /var/www | |
exit 1 | |
fi | |
WEBSERVER=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
T="$(date +%d-%m-%Y-%H-%M-%S)".mkv | |
if [ $# -gt 0 ]; then | |
if echo $1 | grep '\....$' > /dev/null; then | |
T=$1 | |
else | |
T=$1.mkv | |
fi | |
fi | |
# echo $T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.woocommerce.single-product .product .summary .variations { | |
width: 100%; | |
} | |
.woocommerce.single-product .product .summary .variations td { | |
display: block; | |
width: 100%; | |
} | |
.woocommerce.single-product .product .summary .variations td label { | |
font-family: 'Nunito', Helvetica, Arial, sans-serif; | |
letter-spacing: 0px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_countries(){ | |
return array("AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina", "BW" => "Botswana", "BV" => "Bouvet Island", "BR" => "Brazil", "IO" => "British Indian Ocean Territory", "BN" => "Brunei Darussalam", "BG" => "Bulgaria", "BF" => "Burkina Faso", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "C |