Skip to content

Instantly share code, notes, and snippets.

View onatskyy's full-sized avatar
💭
🇺🇦

Alexander Onatskyy onatskyy

💭
🇺🇦
  • Ukraine, Kharkov
View GitHub Profile
@onatskyy
onatskyy / dockergrep.sh
Created July 16, 2019 08:42 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
-- This is v0.6 of the custom script for AlfredApp for iTerm 2.9+
-- Please see https://github.com/stuartcryan/custom-iterm-applescripts-for-alfred/
-- for the latest changes.
-- Please note, if you store the iTerm binary in any other location than the Applications Folder
-- please ensure you update the two locations below (in the format of : rather than / for folder dividers)
-- this gets around issues with AppleScript not handling things well if you have two iTerm binaries on your system... which can happen :D
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
@onatskyy
onatskyy / PersistedConnection.php
Created March 14, 2016 15:15 — forked from makasim/DbIsolationExtension.php
Persisted connection.
<?php
namespace Base\Doctrine\DBAL;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
/**
* Connection wrapper sharing the same db handle across multiple requests
*
* Allows multiple Connection instances to run in the same transaction
@onatskyy
onatskyy / gist:14902cc7977024e09816
Created July 6, 2015 13:24
WriteAttributeExtensionTrait
trait WriteAttributeExtensionTrait
{
/**
* @param string|object $classOrObject
* @param string $attributeName
* @param mixed $attributeValue
*/
public function writeAttribute($classOrObject, $attributeName, $attributeValue)
{
$rp = new \ReflectionProperty($classOrObject, $attributeName);
<?php
namespace Foo\CoreBundle\Form\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormInterface;
/**
* Changes Form->bind() behavior so that it treats not set values as if they