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
192.168.1.11 .test |
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 | |
$host = '0.0.0.0'; | |
$port = 8080; | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1); | |
socket_bind($socket, $host, $port); | |
socket_listen($socket); | |
socket_set_nonblock($socket); | |
echo "Listening on {$host}:{$port}\n\n"; |
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 declare(strict_types = 1); | |
class Uuid implements Guid | |
{ | |
private string $uuid; | |
public function __construct($uuid = null) | |
{ | |
if ($uuid !== null) { | |
if (!static::isValid($uuid)) { |
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
const https = require('https'); | |
const fs = require('fs'); | |
// https://github.com/majodev/google-webfonts-helper/blob/master/server/logic/conf.js | |
const FORMAT_USER_AGENTS = { | |
// see http://www.dvdprojekt.de/category.php?name=Safari for a list of sample user handlers | |
// test generation through running grunt mochaTest:src | |
eot: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)', | |
woff: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0', | |
// must serve complete woff2 file for one variant (no unicode range support yet!) |
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 | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; |
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 vlna(string $text): string | |
{ | |
return preg_replace('/([^a-zA-Z0-9])([ksvzaiou])\s([a-zA-Z0-9]{1,})/i', "\$1\$2\xc2\xa0\$3", $text); | |
} |
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 substring(string $string, int $start, int $length = null): string | |
{ | |
return mb_substr($string, $start, $length, 'UTF-8'); | |
} | |
function lower(string $string): string | |
{ | |
return mb_strtolower($string, 'UTF-8'); |
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 AcmeBundle\Test; | |
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | |
use Doctrine\Common\DataFixtures\Executor\ORMExecutor; | |
use Doctrine\Common\DataFixtures\Loader; | |
use Doctrine\Common\DataFixtures\ReferenceRepository; | |
use Doctrine\DBAL\Connection; | |
use Doctrine\ORM\EntityManager; | |
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader; |
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 Company\SecretBundle\Test; | |
use Doctrine\DBAL\Connection; | |
use Symfony\Bundle\FrameworkBundle\Client as BaseClient; | |
use Symfony\Component\HttpFoundation\File\File; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\KernelInterface; | |
use Symfony\Component\HttpKernel\TerminableInterface; |
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 | |
use Doctrine\ORM\Query\AST; | |
use Doctrine\ORM\Query\TreeWalkerAdapter; | |
class SafeConditionWalker extends TreeWalkerAdapter | |
{ | |
/** @var bool */ | |
private $inCondition = false; | |
/** |
NewerOlder