Skip to content

Instantly share code, notes, and snippets.

View techlab23's full-sized avatar
🚀
Right steps

Shirish Nigam techlab23

🚀
Right steps
  • Techlab23
  • Brisbane, Australia
  • 16:46 (UTC +10:00)
  • X @_shirish
View GitHub Profile
@techlab23
techlab23 / jwtRS256.sh
Created October 4, 2019 16:59 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@techlab23
techlab23 / geoip.sh
Created August 28, 2019 00:46 — forked from kenjij/geoip.sh
Downloading free MaxMind GeoIP file, use with NGINX
# Download the legacy format for NGINX compatibility
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# Unzip
gunzip Geo*.gz
# Copy to /usr/share/GeoIP/
cp Geo*.dat /usr/share/GeoIP/
<?php
/**
* Set preffered countries for Caldera Forms phone fields
*/
add_filter( 'caldera_forms_phone_js_options', function( $options){
//Use ISO_3166-1_alpha-2 formatted country code
$options[ 'preferredCountries' ] = array( 'MX' );
return $options;
});

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@techlab23
techlab23 / example.js
Created February 21, 2018 12:26 — forked from colingourlay/example.js
Lodash / Underscore sort object keys. Like _.sortBy(), but on keys instead of values, returning an object, not an array. Defaults to alphanumeric sort.
var obj = {b: 3, c: 2, a: 1};
_.sortKeysBy(obj);
// {a: 1, b: 3, c: 2}
_.sortKeysBy(obj, function (value, key) {
return value;
});
// {a: 1, c: 2, b: 3}