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 | |
ob_start(); | |
phpinfo(~(2+64)); | |
print str_ireplace('.e {background', '.e {white-space: nowrap; background', ob_get_clean()); |
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 | |
$list = $_pdo->getAll('SELECT s1.`id` `id` FROM cat_section s1 | |
LEFT JOIN cat_section s2 ON s1.`parent_id` = s2.`id` | |
WHERE s1.`parent_id` <> 0 AND s2.`id` IS NULL', [], \PDO::FETCH_COLUMN); | |
$iter = function($sid) | |
use(&$iter, $_pdo) | |
{ | |
foreach($_pdo->getAll('SELECT s1.`id` `id` FROM cat_section s1 |
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
mysql> CREATE TABLE `timetest` (`datetime` DATETIME DEFAULT 0, `timestamp` TIMESTAMP DEFAULT 0); | |
Query OK, 0 rows affected (0,29 sec) | |
mysql> DESCRIBE `timetest`; | |
+-----------+-----------+------+-----+---------------------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-----------+-----------+------+-----+---------------------+-------+ | |
| datetime | datetime | YES | | 0000-00-00 00:00:00 | | | |
| timestamp | timestamp | NO | | 0000-00-00 00:00:00 | | | |
+-----------+-----------+------+-----+---------------------+-------+ |
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
[ | |
{ | |
"str": "Day {day}, " | |
}, | |
{ | |
"if": [ | |
{ | |
"var": "daytime" | |
}, | |
{ |
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
@ECHO OFF | |
SET SERVER="%~dp0php-xdebug.btm" | |
:: PARAMETRIZE [name param] | |
ALIAS /L | |
ALIAS PARAMETRIZE=`SET __name=%1 %+ SET __value=%@REREPLACE[^^--.*?=,,%2] %+ IFF "%[__value]" != "%2" THEN %+ SET %[__name]=%[__value] %+ UNSET __name %+ ENDIFF %+ UNSET __value` | |
SET _enc=UTF-8 | |
SET _session=local | |
DO param IN /Q %$ "" |
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/sh | |
git status --branch --untracked-files=no --porcelain=2 | ( | |
while IFS=' .' read -r _s _b _name _value; do | |
[ "$_s" = "#" ] || break | |
if [ "$_b" = "branch" ]; then | |
case "$_name" in | |
head|upstream|ab) | |
eval "_$_name='$_value'" | |
;; |
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 AnrDaemon\CcWeb; | |
use | |
AnrDaemon\CcWeb\Interfaces; | |
class SettingsManager | |
implements Interfaces\SettingsManager | |
{ |
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 Utility | |
{ | |
public function createValidator($spec) | |
{ | |
list($type, $name) = explode(":", $spec, 2) + ['', '']; | |
$options = ["default" => null]; | |
switch($type) | |
{ |
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 | |
/** Wrapper for actual thing that do the network talking. | |
This could be encapsulation for curl, Guzzle, Net\Browser, etc. | |
The wrapper offers a known stable interface to external library. | |
*/ | |
class Service\Api\Wrapper | |
{ |