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
[user] | |
name = telless | |
email = t@elless.me | |
[core] | |
excludesfile = ~/.gitignore_global | |
editor = vscode | |
# set autocrlf = true for Windows | |
autocrlf = input | |
safecrlf = true | |
[push] |
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 | |
abstract class BooleanHelper | |
{ | |
public static function equalTrue($value): bool | |
{ | |
return self::process($value) === self::getTrueValue(); | |
} | |
public static function notEqualTrue($value): bool |
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 A | |
{ | |
public $prop; | |
public function __construct() | |
{ | |
$this->prop = 'prop'; | |
} |
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 | |
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 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 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 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 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 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 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) { |
NewerOlder