Skip to content

Instantly share code, notes, and snippets.

View anyt's full-sized avatar

Andrii Yatsenko anyt

View GitHub Profile
@anyt
anyt / .bash_profile
Last active June 16, 2016 08:03
My dev env
#############
# Colors #
#############
export PS1=" \[\e[32;1m\]\u\[\e[0m\]\[\e[32m\]@\h\[\e[36m\]\w \[\e[33m\]\$ \[\e[0m\]"
#export PATH=/usr/local/bin:$PATH
#export PATH=/Applications/MAMP/bin/php/php5.6.2/bin/:$PATH
#export ORO_PHP_PATH=/Applications/MAMP/bin/php/php5.6.2/bin/
#export PATH=/usr/local/php5/bin:$PATH
#export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"
<?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Use APC for autoloading to improve performance
// Change 'sf2' by the prefix you want in order to prevent key conflict with another application
/*
layout:
actions:
- @add:
id: meta_title
parentId: head
blockType: meta
options:
name: 'title'
content: '=data["navigation_title"].getTitle()'
@anyt
anyt / fooButton.html.twig
Created September 19, 2016 18:15
Add button to "More Actions" dropdown
{{ UI.clientButton({
'dataUrl': path(
'acme_demo_foo_route', {
entityClass: oro_class_name(entity, true),
entityId: entity.id
}),
'aCss': 'no-hash',
'iCss': 'icon-comment-alt',
'dataId': entity.id,
'label': 'acme_demo.contact.action.foo'|trans,
@anyt
anyt / doctrine
Last active November 3, 2016 16:57
cloc statistic
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 981 19853 60748 73262
XML 58 217 18 1418
Markdown 20 500 0 1400
YAML 56 138 3 1012
XSD 3 116 17 973
JSON 13 0 0 516
Twig 2 67 2 391
[xdebug]
;zend_extension="/usr/local/opt/php71-xdebug/xdebug.so"
xdebug.max_nesting_level = 1000
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=On
xdebug.remote_connect_back=ON
xdebug.remote_port=9001
xdebug.remote_autostart=1
#xdebug.remote_log=/Users/anyt/Sites/logs/xdebug.log
<?php
namespace Demo\Bundle\CalendarBundle\Migrations\Schema\v2_3;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\EntityExtendBundle\Tools\ExtendDbIdentifierNameGenerator;
use Oro\Bundle\MigrationBundle\Migration\Extension\NameGeneratorAwareInterface;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
@anyt
anyt / AppBundle.php
Last active May 17, 2018 16:06
Translate Task Priority field
<?php
namespace AppBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
}

Docker

Pgsql

Backup

docker exec -t $(docker-compose ps -q pgsql) pg_dumpall -c -U oro_db_user > dump.psql

Restore

  1. Install PHP 7.3
brew install [email protected] 
  1. Run commands from the above command output. In my environment there are two of them after this phrase:

If you need to have [email protected] first in your PATH run:

 echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' &gt;&gt; ~/.zshrc