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
# Reset | |
Color_Off='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green | |
Yellow='\e[0;33m' # Yellow | |
Blue='\e[0;34m' # Blue | |
Purple='\e[0;35m' # Purple |
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
/** | |
* filter_input() for arbitrary arrays. | |
* | |
* @param array $data The array to fetch the data from. | |
* @param string $name The array key of interest. | |
* @param integer $filter A filter constant | |
* @param integer|array $options Either a filter flag or an array denoting | |
* flags and/or options. | |
* @return mixed The requested value or FALSE or NULL. | |
*/ |
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 | |
namespace Dormilich\Core; | |
/** | |
* Set a custom error handler that is valid as long as this instance is not | |
* garbage collected. | |
*/ | |
class ErrorHandler | |
{ |
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
/** | |
* Create an immutable vector object. There's no assumption made on what | |
* the "unit" and hence the meaning of the vector is. | |
* | |
* @param (Number) x - vector value in x-direction | |
* @param (Number) y - vector value in y-direction | |
* @return (Object) | |
*/ | |
function vector(x, y) | |
{ |
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 | |
/** | |
* @param integer $prefix CIDR prefix (24..32). | |
* @return array | |
*/ | |
function example(int $prefix): array | |
{ | |
// Networks for documentation (RFC 5737) | |
$source = ['192.0.2.0', '198.51.100.0', '203.0.113.0']; |