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 | |
| /** | |
| * Value should be an IBAN number | |
| * | |
| * | |
| * @param string | |
| * @return bool | |
| */ | |
| function iban($str) | |
| { |
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 | |
| // set your database path | |
| $firebase = 'https://myrealtimedb.firebaseio.com/'; | |
| // Update or Save to fireBase | |
| $data = FireBaseJson('PUT','MyContentPath', 'MyContentData'); | |
| print_r($data); | |
| // Get from fireBase | |
| $data = FireBaseJson('GET', 'MyContentPath'); |
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 | |
| function imageHash($image_file) { | |
| // check if the file is existed and is readable | |
| if(file_exists($image_file) && is_readable($image_file)) { | |
| return false; | |
| } | |
| // get image dimensions | |
| list($width, $height) = getimagesize($image_file); |
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 | |
| // script startup time and memory usage | |
| $mem_usage = memory_get_usage(); | |
| $time_usage = microtime(true); | |
| $return = 'FALSE'; | |
| $password = '070162'; | |
| // get password list file from https://github.com/danielmiessler/SecLists/tree/master/Passwords | |
| /* don't touch the above lines */ | |
| /* ------------------------------------------------------------------- */ |
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 | |
| //Tiny Cache system | |
| function file_cache_contents($url, $cache_time=360000) { // 60*60*5 | |
| $cache_dir = __DIR__.'/cache/'; | |
| $cache_file = $cache_dir.md5($url).'.cache'; | |
| @mkdir($cache_dir, 0775, true); | |
| // return data from cached file if file exists and not expired | |
| if(file_exists($cache_file) && filemtime($cache_file)+$cache_time >= time()) { | |
| return(unserialize(file_get_contents($cache_file))); | |
| } |
NewerOlder