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 | |
| use Symfony\Component\HttpKernel\Event\FilterControllerEvent; | |
| use Symfony\Component\HttpKernel\HttpKernelInterface; | |
| use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
| use Symfony\Component\HttpKernel\KernelEvents; | |
| use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
| class AcceptHeaderKernelListener implements EventSubscriberInterface | |
| { |
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 | |
| function getFormattedOutput($string) | |
| { | |
| $tags = array( | |
| 'bold' => 1, 'dark' => 2, 'italic' => 3, 'underline' => 4, 'blink' => 5, 'reverse' => 7, 'concealed' => 8, | |
| 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, | |
| 'bg_black' => 40, 'bg_red' => 41, 'bg_green' => 42, 'bg_yellow' => 43, 'bg_blue' => 44, 'bg_magenta' => 45, 'bg_cyan' => 46, 'bg_white' => 47 | |
| ); |
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 TimeoutException extends RuntimeException {} | |
| class Timeout | |
| { | |
| private $active; | |
| public function set($seconds) | |
| { |
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 | |
| use Ratchet\MessageComponentInterface; | |
| use Ratchet\ConnectionInterface; | |
| class MyApp1 implements MessageComponentInterface { | |
| public function onOpen(ConnectionInterface $conn) { | |
| } | |
| public function onMessage(ConnectionInterface $from, $msg) { | |
| } |
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 | |
| declare(ticks = 1); | |
| # Einhorn sends a "USR2" signal to our server process | |
| # in case the server shuts down. | |
| pcntl_signal(SIGUSR2, function() { | |
| fwrite(STDERR, "Worker shutting down...\n"); | |
| exit(0); | |
| }); |
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 utils | |
| { | |
| import com.adobe.utils.AGALMiniAssembler; | |
| import flash.display3D.*; | |
| import flash.geom.*; | |
| import starling.core.RenderSupport; | |
| import starling.core.Starling; | |
| import starling.display.DisplayObject; |
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 | |
| use Doctrine\ORM\EntityManager, | |
| Doctrine\ORM\Configuration, | |
| Doctrine\ORM\Mapping\ClassMetadata; | |
| /** | |
| * Active Entity trait | |
| * | |
| * Limitations: a class can only ever be assocaited with ONE active entity manager. Multiple entity managers |
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 MyCompany\Bundle\MyBundle\Command; | |
| use Symfony\Bundle\FrameworkBundle\Command\Command; | |
| use Symfony\Component\Console\Input\InputArgument; | |
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Input\InputOption; | |
| use Symfony\Component\Console\Output\OutputInterface; | |
| use Symfony\Component\HttpFoundation\Request; |
NewerOlder