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 | |
class Console | |
{ | |
/** | |
* @var string[] | |
*/ | |
public static $FOREGROUND_COLORS | |
= [ | |
'black' => '0;30', | |
'dark_gray' => '1;30', |
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 traineratwot; | |
use FilesystemIterator; | |
use RecursiveDirectoryIterator; | |
use RecursiveIteratorIterator; | |
use RuntimeException; | |
use SplFileInfo; |
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
class ThreeWayCheckbox { | |
private elem: JQuery<HTMLElement>; | |
state = 0; | |
private callbacks: Function[] = []; | |
constructor(elem: JQuery<HTMLElement>) { | |
this.elem = elem | |
try { | |
this.elem.on('click', (e) => { | |
switch (this.state) { |
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 | |
class PostFile | |
{ | |
public $name = NULL; | |
public $path = NULL; | |
public $ext = NULL; | |
public $fullName = NULL; | |
public $type = NULL; | |
/** | |
* @var int |
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
<? | |
function jsonValidate($string, $assoc = TRUE, $depth = 1024) | |
{ | |
try { | |
if (!is_string($string)) { | |
return $string; | |
} | |
$error = 0; | |
// decode the JSON data | |
$string = preg_replace('/[[:cntrl:]]/', '', $string); |
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 | |
class FTP | |
{ | |
/* | |
* Connection | |
*/ | |
private $connection; | |
/* | |
* connectionString |
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 | |
class CsvTable | |
{ | |
/* @var string chr(239) . chr(187) . chr(191) */ | |
public $utf8bom; | |
/* @var string Charset */ | |
public $inputCharset; | |
public $cache; | |
public $currentRow = -1; | |
public $clearRegexp = '@[^[:ascii:]A-я]+@u'; |
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
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking" | "clipboard-write" | "clipboard-read"; | |
interface MyPermissionDescriptor { | |
name: PermissionName; | |
} | |
export class clipboard { | |
mode: 'navigator' | 'fallback' | 'notSupport' = 'navigator'; | |
timeLimit: number = 100; | |
response?: string; |
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 name2class($name) | |
{ | |
$name = preg_replace("@([A-Z])@","_$1",$name); | |
$name = strtr($name, [ | |
'\\' => '_', | |
'/' => '_', | |
'-' => '_', | |
' ' => '_', | |
'*' => '_', |
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
0.0.0.0 test.troyan | |
0.0.0.0 bing.com |
OlderNewer