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 | |
/** | |
* Make sure lines are right length in mail body | |
* @param string mail body | |
* @param int max line length (default 68) | |
* @param bool only return bool instead of modified body (default false) | |
* @return string|bool validated body | |
*/ | |
function validateMailBody($sBody, $iMaxLen = 68, $bReturnBool = 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
<?php | |
class FlashMsg { | |
const SUCCESS = 'success'; | |
const WARNING = 'warning'; | |
const ERROR = 'error'; | |
/** | |
* Static msgs holder |
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 | |
class Enum { | |
private static $constCacheArray = NULL; | |
private static function getConstants() { | |
if (self::$constCacheArray == NULL) { | |
self::$constCacheArray = []; | |
} | |
$calledClass = get_called_class(); |
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 | |
class Iter { | |
private $arr; | |
private $result; | |
public function __construct($array) { | |
$this->arr = $array; | |
} |
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 | |
$p = "/<\s*[^\/].*\s*>/"; | |
$str = " | |
<div> | |
<p> | |
Tessttst jhsdfb skfsdk | |
</p> | |
</div> |
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 | |
class Event | |
{ | |
public static $events; | |
public function __construct() | |
{ | |
self::$events = []; |
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
fn main() { | |
let max: i32 = 101; | |
let mut l: Vec<String> = Vec::new(); | |
for i in 0..max | |
{ | |
l.push(fizz_buzz(i)); | |
} |
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
(?:(?<http>http(?:s*)):\/\/(?<host>staging.roomraccoon.com))*(?<path>(?:\/\w*)*)(?<qs>(?:\?\w*=\w*)(?:\&\w*=\w*)) |
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 | |
$xml = [ | |
"payments" => [ | |
[ | |
"amount" => "100", | |
"initials" => "ih" | |
], | |
[ | |
"amount" => "1000", |
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 | |
class Benchmark | |
{ | |
public $time; | |
private $startTime; | |
private $stopTime; | |
public function go($callback) | |
{ |