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 | |
abstract class BooleanHelper | |
{ | |
public static function equalTrue($value): bool | |
{ | |
return self::process($value) === self::getTrueValue(); | |
} | |
public static function notEqualTrue($value): bool |
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 | |
abstract class Calculatable | |
{ | |
const SUBTRACT_ACTION = 'subtract'; | |
const SUBTRACT_SYMBOL = '-'; | |
const ADD_ACTION = 'add'; | |
const ADD_SYMBOL = '+'; | |
public function add(Calculatable $child): Calculatable |
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 | |
namespace AppBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use JMS\Serializer\Annotation as JMS; | |
/** | |
* Class OtpState | |
* @package AppBundle\Entity |
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 | |
$a = [1, 1, 1, 2, 3, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6]; | |
$count = []; | |
foreach ($a as $v) { | |
if (isset($count[$v])) { | |
unset($count[$v]); | |
} else { | |
$count[$v] = true; | |
} |
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 ODList | |
{ | |
/** string $name */ | |
public $name; | |
/** ODList|null $next */ | |
public $next; |
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 FooParent | |
{ | |
} | |
class Foo extends FooParent | |
{ | |
} |
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 A | |
{ | |
public $prop; | |
public function __construct() | |
{ | |
$this->prop = 'prop'; | |
} |
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
function isBalanced(str) { | |
const strArr = str.split(''); | |
let balanced = true; | |
let stack = []; | |
const len = strArr.length; | |
for (i = 0; i < len; i++) { | |
switch (strArr[i]) { | |
case '{': |
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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"strconv" | |
"time" | |
) | |
func lPrint(ch chan string, delay time.Duration) { |
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
zend_extension=xdebug.so | |
; Enable remote mode | |
xdebug.remote_enable=1 | |
; Autostart on every request | |
xdebug.remote_autostart=1 | |
; Autodetect requester IP | |
xdebug.remote_connect_back=1 | |
; Set remote port | |
xdebug.remote_port=9000 | |
; Usually work even without it |
NewerOlder