Skip to content

Instantly share code, notes, and snippets.

View r8or0pz's full-sized avatar
🎯
Focusing

Roman Borysenko r8or0pz

🎯
Focusing
View GitHub Profile
num_lines = sum(1 for line in open('myfile.txt'))
docker inspect --format {{.LogPath}} <containerid> # Return Docker log path
<?php
namespace BackendLib\EventListener;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use BackendLib\Entity\iEmbeddedEntityRelationFixable;
use BackendLib\Annotation\EmbeddedEntityRelationFixer;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Inflector\Inflector;
<?php
namespace App\Form;
use App\Entity\VehicleRegisteredType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
@r8or0pz
r8or0pz / test1.php
Last active December 25, 2018 12:11
<?php
public function createCollection(QueryBuilder $qb, array $args, Callable $createLinkFunc)
{
// ...
$pager = new Pagerfanta(new DoctrineORMAdapter($qb));
}
<?php
namespace Controller;
use Symfony\Component\HttpFoundation\Request;
class FooController
{
public function doSomething(Request $request, AwesomeService $service)
{
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-name
RewriteCond %{THE_REQUEST} ^GET\ /elb-health-check [NC]
RewriteRule ^ - [R=200]
RewriteCond %{THE_REQUEST} ^GET\ /route53-health-check [NC]
RewriteRule ^ - [R=200]
RewriteEngine On
RewriteRule ^/servicestatus$ /servicestatus.php [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]