π―
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
| /*-------------------------------------------------+ | |
| | Flattens FQL (Facebook Query Language) results in | |
| | a good format | |
| +-------------------------------------------------*/ | |
| function flattenFQL($array) { | |
| if (!is_array($array)) { | |
| return $array; | |
| } | |
| $result = array(); | |
| foreach ($array as $data) { |
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
| /* ============================================================ | |
| | :=Sleep (Delay) | |
| =============================================================== */ | |
| // Milliseconds | |
| function sleep_ms(millisecs) { | |
| var initiation = new Date().getTime(); | |
| while ((new Date().getTime() - initiation) < millisecs); | |
| } | |
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 | |
| /*-------------------------------------------------+ | |
| | Checks if the http request is an AJAX call. | |
| +-------------------------------------------------*/ | |
| function is_ajax() { | |
| return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower(getenv('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest')); | |
| } | |
| ?> |
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
| var getGooglAuthToken = function(b){ | |
| var c = function(){ | |
| for (var l=0, m=0, ml=arguments.length; m<ml; m++) l = l + arguments[m] & 4294967295; | |
| return l; | |
| } | |
| var d = function(l){ | |
| l = String(l > 0 ? l : l + 4294967296); | |
| var m = l; | |
| for (var o=0, n=false, p=m.length-1; p>=0; --p){ | |
| var q = Number(m.charAt(p)); |
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 Spinner | |
| =============================================================== */ | |
| function preg_quote(str, delimiter) { | |
| return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&'); | |
| } | |
| function spin(text) { | |
| var matches = text.match(/{[^<]+/gi); | |
| if (matches === null) { |
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
| /* ============================================================ | |
| | :=Stop Window Refresh | |
| =============================================================== */ | |
| function stopRefresh() { | |
| if (window.myRefresh && window.clearTimeout) window.clearTimeout(myRefresh); | |
| } |
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
| var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; | |
| var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; | |
| var is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1; | |
| if(is_chrome) { | |
| alert("This message is for Chrome Users!"); | |
| } else if(is_firefox) { | |
| alert("This message is for Firefox Users!"); | |
| } else if(is_opera) { | |
| alert("This message is for Opera Users!"); |
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
| function contains($str, $content, $ignorecase=true) { | |
| if ($ignorecase){ | |
| $str = strtolower($str); | |
| $content = strtolower($content); | |
| } | |
| return strpos($content,$str) ? true : false; | |
| } |
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 current visitors count (whos.amung.us) | |
| +-------------------------------------------------*/ | |
| function getAmungStats($amung) { | |
| if(!isset($amung)) return false; | |
| $url = 'http://whos.amung.us/sitecount/' . $amung . '/'; | |
| $result = ''; | |
| if (function_exists('curl_init')) { | |
| $http_headers = array(); |