-
Login to https://www.linode.com & create a linode server.
-
Install Ubuntu Latest LTS — Long Term Support — version on it.
-
Login to the server using SSH.
-
Install easy engine on it.
This file contains hidden or 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
https://geoipify.whoisxmlapi.com/api/v1?apiKey=YOUR_API_KEY&ipAddress=IP_ADDRESS_TO_BE_QUERIED |
This file contains hidden or 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
npm init -y |
This file contains hidden or 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
npm install simple-geoip --save |
This file contains hidden or 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
// Include the package. | |
const simpleGeoIP = require('simple-geoip'); | |
// Create a new instance of the package using your API key. | |
let geoIP = new simpleGeoIP('YOUR_API_KEY'); | |
// Send a request for GeoIP lookup. | |
geoIP.lookup('8.8.8.8', (err, data) => { | |
if (err) throw err; // Look for errors (if any). | |
console.log(data); // Dump the results to the log. |
This file contains hidden or 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
# Alias for adding upstream remote. | |
# Usage: grau https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git | |
alias grau="git remote add upstream" | |
# Function to sync fork with upstream remote. | |
function gsyncfork() { | |
git fetch upstream | |
git pull upstream master | |
git push origin master | |
} |
This file contains hidden or 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 | |
/** | |
* WP Session Entry Example. | |
*/ | |
$wp_session_entry = array( | |
'a97941ac30b27091e9016f9fbe2a16a798a5dd17d7db58235890107bb6ce485f' => array( // User Session Token. | |
'expiration' => 1545975258 // Session Expiration Timestamp. | |
'ip' => '172.17.0.1' // IP Address of the User. | |
'ua' => 'Mozilla/5.0 (Macintosh...' // User Agent. | |
'login' => 1545802458 // Login Timestamp. |
This file contains hidden or 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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
This file contains hidden or 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 | |
// $choice contains the user's input to opt-in or out. | |
if ( 'yes' === $choice ) { | |
if ( ! is_multisite() ) { | |
my_freemius()->opt_in(); // Opt in. | |
} else { | |
// Get all sites on the WP multisite network. | |
$sites = Freemius::get_sites(); | |
$sites_data = array(); |