Skip to content

Instantly share code, notes, and snippets.

View velikanov's full-sized avatar
☺️

Serge Velikan velikanov

☺️
View GitHub Profile
include:
- php.fpm
php_fpm:
pkg.installed: []
@velikanov
velikanov / query.json
Created August 31, 2015 11:49
mongo query
db.tracker_lead.aggregate([
{
$group: {
_id: {
year: {
$year: "$created_at"
},
month: {
$month: "$created_at"
},
@velikanov
velikanov / gist:45e089118964721bffb8
Created July 5, 2015 11:47
socket_read hang problem
if (false === ($socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
$errorMessages[] = 'socket_create';
$errorMessages[] = socket_strerror(socket_last_error());
$errorCode = 1;
} else {
$container = $this->getContainer();
if (false === (socket_connect($socket, '174.37.69.2', '443'))) {
$errorMessages[] = 'socket_connect';
@velikanov
velikanov / command.php
Last active August 29, 2015 14:19
Can not get the array of entities config from within the Command
protected function execute(InputInterface $input, OutputInterface $output)
{
$container = $this->getContainer();
$doctrine = $container->get('doctrine');
$monitoringEntities = $container->getParameter('monitoring.entities');
foreach ($monitoringEntities as $monitoringEntity) {
$output->writeln($monitoringEntity);
@velikanov
velikanov / AbstractService.php
Created April 17, 2015 14:33
PHPSpec+Symfony Issue
<?php
namespace AppBundle\Service;
use Symfony\Component\DependencyInjection\Container;
abstract class AbstractService implements SomeInterface {
protected $container;
public function __construct(Container $container)
{
@velikanov
velikanov / FeatureContext.php
Created February 1, 2015 12:43
Behat Symfony2 Extension variable issue
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
/**
* Defines application features from the specific context.
*/