This file contains 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))); | |
} |
This file contains 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 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 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 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 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
#!/bin/bash | |
# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; version 2 of the License. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains 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
#!/bin/bash | |
# Copyright (C) 2019 Daif Alazmi | |
# | |
# This program is free software: you can redistribute it and/or modify it under | |
# the terms of the GNU Lesser General Public License as published by the Free | |
# Software Foundation, either version 3 of the License, or (at your option) any | |
# later version. | |
# | |
# This program is distributed in the hope that it will be useful, but WITHOUT |
This file contains 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
#!/bin/bash | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains 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 | |
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* BinarySearch.phps 0.1 | |
* Implementation of binary search in PHP | |
* by Daif Alazmi (http://daif.net) |
This file contains 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
#!/bin/bash | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
OlderNewer