Skip to content

Instantly share code, notes, and snippets.

View Itach1Uchixa's full-sized avatar

Javlonbek Kakhramonov Itach1Uchixa

View GitHub Profile
@Itach1Uchixa
Itach1Uchixa / LocalizedTreeRouteFactory.php
Last active March 17, 2020 21:02
Zend Framework 3 Localized route concept
<?php
/**
* @author Kakhramonov Javlonbek <kakjavlon@gmail.com>
* @version 1.1.2
*/
namespace Application\Factory;
use Interop\Container\ContainerInterface;
use Application\Router\LocalizedTreeRouteStack;
use Zend\Router\RouterConfigTrait;
@Itach1Uchixa
Itach1Uchixa / LocalizedTreeRouteFactory.php
Last active March 18, 2017 18:39
Zend Framework 2 Localized route concept
<?php
/**
* @author Kakhramonov Javlonbek <kakjavlon@gmail.com>
* @version 1.0.0
*/
namespace Application\Factory;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Mvc\Service\RouterConfigTrait;
use Zend\Mvc\Router\RouteStackInterface;
@Itach1Uchixa
Itach1Uchixa / date_create_from_format_with_w.php
Created April 20, 2017 17:10
Create date time with weekday placeholder
<?php
/**
* Create date time with weekday placeholder
*
* @param string $format
* @param string $time
* @param null|DateTime $timezone
* @return bool|DateTime
*/
@Itach1Uchixa
Itach1Uchixa / AbstractClient.php
Last active May 19, 2017 09:57
How to avoid setters
<?php
/**
* @author Kakhramonov Javlonbek <kakjavlon@gmail.com>
*/
namespace Module\Entity;
use Application\Entity\TranslatableEntityTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Batch IP addresses inputter to kerio control ip address groups
* Input IP addresses must be splitted with character to match \s regex pattern
*
* @author Javlonbek Kakhramonov <kakjavlon@gmail.com>
*/
(function (selector) {
var ips = prompt();
var ipAdresses = ips.split(/\s/);
var addBtn = selector('#addressGroupList_k_bottomToolbar_k_btnAdd button');
@Itach1Uchixa
Itach1Uchixa / clean_but_complex.php
Last active September 12, 2018 09:37
Custom collections with doctrine 2
<?php
// clean but complex way
namespace YourDomain\Entities
{
use Doctrine\Common\Collections\Collection as DoctrineCollection;
/** @MappedSuperclass */
class SomeEntity
@Itach1Uchixa
Itach1Uchixa / Date.php
Created October 30, 2018 11:31
Value objects
<?php
/**
* @author Kakhramonov Javlonbek <kakjavlon@gmail.com>
* @copyright 2018 Foreach.Soft Ltd. (http://each.uz)
*/
declare(strict_types=1);
namespace Acme\Value;
use DateTimeImmutable;