Skip to content

Instantly share code, notes, and snippets.

View emodric's full-sized avatar
🇭🇷
Adventure, excitement... A Jedi craves not these things!

Edi Modrić emodric

🇭🇷
Adventure, excitement... A Jedi craves not these things!
View GitHub Profile
eddie@abyss: ~/repos/netgen/TagsBundle/vendor/ezsystems/ezpublish-kernel [master] $ grep -irn "criterions" *
eZ/Publish/SPI/Persistence/Content/Search/Handler.php:42: * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions
eZ/Publish/API/Repository/SearchService.php:45: * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions
eZ/Publish/API/Repository/Values/Content/Search/SearchResult.php:35: * criterions the wrong spelled value is replaced by a corrected one (TBD).
eZ/Publish/API/Repository/Values/Content/Query/Criterion.php:43: * Additional value data, required by some criterions, MapLocationDistance for instance
eZ/Publish/API/Repository/Values/Content/Query/Criterion/Location.php:18: * This is the base class for Location criterions
eZ/Publish/Core/Repository/SearchService.php:147: * Checks that $criteria does not contain Location
eddie@abyss: ~ $ git clone git@github.com:netgen/TagsBundle.git
Cloning into 'TagsBundle'...
remote: Reusing existing pack: 1916, done.
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1924 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1924/1924), 335.23 KiB | 178.00 KiB/s, done.
Resolving deltas: 100% (625/625), done.
Checking connectivity... done.
eddie@abyss: ~ $ cd TagsBundle/
@emodric
emodric / gist:87a166a3cfb0be42e1f6
Created June 10, 2014 08:39
TagsBundle tests failure
eddie@abyss: ~/repos/netgen/TagsBundle [fixpgsqlinvalidcolumn] $ phpunit -c phpunit.xml
PHPUnit 4.1.0 by Sebastian Bergmann.
Configuration read from /home/eddie/repos/netgen/TagsBundle/phpunit.xml
............................................................... 63 / 222 ( 28%)
.........................................................I..... 126 / 222 ( 56%)
............................................................I.. 189 / 222 ( 85%)
...........................F.....
@emodric
emodric / gist:79fb2a3cc8dc35be5b12
Created June 20, 2014 15:23
Loading eZ Publish 5 role with Tag policy limitation
eddie@abyss: ~/repos/emodric/rest_scripts [master] $ ./json/roles/08-loadRolePolicies.sh
GET /api/ezp/v2/user/roles/5/policies HTTP/1.1
Accept: application/vnd.ez.api.PolicyList+json
Accept-Encoding: gzip, deflate, compress
Host: ezpublish5.local
User-Agent: HTTPie/0.7.2
HTTP/1.1 200 OK
<?php
class Test
{
public $id;
public function __construct($id)
{
$this->id = $id;
}
}
TASK: [apache | Install Apache] ***********************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE apt name=apache2 state=present update_cache=yes
<127.0.0.1> EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/eddie/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o Port=2222 -o IdentityFile="/var/www/html/vagrant-ansible-symfony/.vagrant/machines/default/virtualbox/private_key" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 127.0.0.1 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1421918430.46-279641966512076 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1421918430.46-279641966512076 && echo $HOME/.ansible/tmp/ansible-tmp-1421918430.46-279641966512076'
<127.0.0.1> PUT /tmp/tmp7NpaJs TO /home/vagrant/.ansible/tmp/ansib
eddie@abyss: ~/www/vagrant-ansible-symfony [feature/ez-setup] $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: vagrant-ansible-symfony_default_1422349667711_72214
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
eddie@abyss: ~/www/vagrant-ansible-symfony [feature/ez-setup] $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: vagrant-ansible-symfony_default_1422352584617_91260
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
@emodric
emodric / gist:34166413297e0990e0c2
Created April 14, 2015 11:09
Vagrant composer update
vagrant@vagrant-ubuntu-trusty-64:/var/www/project$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:974
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 974, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(974): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(784): Symfony\Component\Console\Application->ge
@emodric
emodric / eztags.tpl
Created January 6, 2012 15:58
eZ Tags hack to support automatic placement of tags in content edit interface
{ezcss_require( array( 'tagssuggest.css', 'jqmodal.css', 'contentstructure-tree.css' ) )}
{ezscript_require( array( 'ezjsc::jquery', 'ezjsc::jqueryio', 'jqModal.js', 'jquery.tagsSuggest.js', 'tagsSuggest-init.js' ) )}
{def $has_add_access = false()}
{def $root_tag = fetch( tags, tag, hash( tag_id, $attribute.contentclass_attribute.data_int1 ) )}
{if $root_tag}{def $root_tag_id = $root_tag.id}{else}{def $root_tag_id = 0}{/if}
{def $user_limitations = user_limitations( 'tags', 'add' )}
{if $user_limitations['accessWord']|ne( 'no' )}
{if is_unset( $user_limitations['simplifiedLimitations']['Tag'] )}