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
/** | |
* Text cleaner | |
* | |
* Primary sources: | |
* - https://stackoverflow.com/questions/17219916/json-decode-returns-json-error-syntax-but-online-formatter-says-the-json-is-ok | |
* - https://stackoverflow.com/questions/2348152/detect-bad-json-data-in-php-json-decode | |
*/ | |
function decontaminate_text( | |
$text, | |
$remove_tags = true, |
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
Barba.Dispatcher.on('newPageReady', function(currentStatus, oldStatus, container, newPageRawHTML) { | |
// html head parser borrowed from jquery pjax | |
var $newPageHead = $( '<head />' ).html( | |
$.parseHTML( | |
newPageRawHTML.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0] | |
, document | |
, true | |
) | |
); | |
var headTags = [ |
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
Get Country | |
----------- | |
<?php | |
$country = file_get_contents('http://api.hostip.info/country.php?ip='.$_SERVER['REMOTE_ADDR']); | |
echo $country; //Remove this line | |
?> |