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
| require 'iconv' | |
| require 'active_support/core_ext/string' | |
| String.class_eval do | |
| def slugify | |
| Iconv.conv('ASCII//TRANSLIT//IGNORE', 'UTF8', self.mb_chars.downcase).parameterize | |
| end | |
| end |
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 | |
| date_default_timezone_set('UTC'); | |
| $micro = explode(" ", microtime()); | |
| $micros = substr($micro[0], 1, 7); | |
| $date = date('Y-m-d H:m:i'); | |
| $dtString = $date . $micros; | |
| $datetime = DateTime::createFromFormat('Y-m-d H:m:i.u', $dtString, new DateTimeZone('UTC')); | |
| $datetime2 = new DateTime($dtString, new DateTimeZone('UTC')); | |
| $datetime3 = new DateTime("now", new DateTimeZone('UTC')); |
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 Opesho\CommonBundle\Doctrine\ODM\MongoDB\Types; | |
| use Doctrine\ODM\MongoDB\Types\Type; | |
| use Opesho\CommonBundle\Utils\DateUtils; | |
| class DateType extends Type | |
| { | |
| public function convertToDatabaseValue($value) |
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 Opesho\CommonBundle\Command; | |
| use MongoClient; | |
| use MongoDate; | |
| use MongoDB; | |
| use SplStack; | |
| use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
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 AddCommandHandlersPass implements CompilerPassInterface | |
| { | |
| /** | |
| * You can modify the container here before it is dumped to PHP code. | |
| * | |
| * @param ContainerBuilder $container |
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 | |
| /** | |
| * Event that handles asynchronously via rabbitmq queue | |
| * | |
| * Usage: | |
| * <code> | |
| * $event = new DeferredEvent(new EmailEvent("from@gmail.com", "to@gmail.com", "message")); | |
| * $dispatcher->dispatch("email.event", $event); |
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; | |
| use AppBundle\File\MimeType\SVGMimeTypeGuesser; | |
| use Symfony\Component\DependencyInjection\ContainerBuilder; | |
| use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser; | |
| use Symfony\Component\HttpKernel\Bundle\Bundle; | |
| class AppBundle extends Bundle |
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\Twig\Extension; | |
| use Symfony\Component\HttpFoundation\File\File; | |
| use Symfony\Component\HttpKernel\KernelInterface; | |
| /** | |
| * Usage example, | |
| * <img src="{{ data_uri('@AcmeBundle/Resources/public/images/logo.svg') }}"> |
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\Twig\Extension; | |
| use Symfony\Component\HttpFoundation\RequestStack; | |
| use Twig_SimpleFunction; | |
| class RouteChecker extends \Twig_Extension | |
| { | |
| /** @var RequestStack */ |
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
| RemoteException { | |
| errorCode: 39, | |
| className: 'java.lang.NullPointerException', | |
| message: null, | |
| stackTrace: | |
| [ StackTraceElement { | |
| declaringClass: 'com.hazelcast.replicatedmap.impl.operation.ContainsKeyOperation', | |
| methodName: 'run', | |
| fileName: 'ContainsKeyOperation.java', | |
| lineNumber: 46 }, |