Skip to content

Instantly share code, notes, and snippets.

@hugeval
hugeval / sql error.txt
Created August 26, 2015 16:46
sql error
An exception has been thrown during the rendering of a template ("An exception occurred while executing 'SELECT COUNT(*) FROM (SELECT o0_.id AS id0, o0_.name AS name1, o1_.email AS email2, o2_.phone AS phone3 FROM orocrm_account o0_ INNER JOIN oro_navigation_history o3_ ON (o0_.id = o3_.entity_id AND o3_.route = 'orocrm_account_view') LEFT JOIN orocrm_contact o4_ ON o0_.default_contact_id = o4_.id AND (o4_.organization_id = 1) LEFT JOIN orocrm_contact_email o1_ ON o4_.id = o1_.owner_id AND (o1_.is_primary = 1) LEFT JOIN orocrm_contact_phone o2_ ON o4_.id = o2_.owner_id AND (o2_.is_primary = 1) WHERE o3_.user_id = 54 AND (o0_.organization_id = 1 OR EXISTS (SELECT 1 AS sclr4 FROM acl_entries a5_ WHERE o0_.id = a5_.record_id AND o0_.id = AND o0_.id = )) GROUP BY id0, name1, email2, phone3) AS e':
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND o0_.id = )) GROUP BY id
<?php
$text = "Блочная модель документа
В этом курсе мы разберёмся как управлять размерами и расположением элементов, задавать отступы и рамки,
а также рассмотрим различные типы элементов и их особенности. Это первый и самый важный шаг к созданию
страниц со сложной сеткой и сложных декоративных элементов.";
$result = preg_split('/[\pZ\pC]+/u', $text);
echo 'Words Count: ' . count($result) . PHP_EOL;
<?php
$obj = new \stdClass();
$obj->attr = 'attr';
$closure = function(){
echo $this->attr . PHP_EOL;
};
$bindClosure = \Closure::bind($closure, $obj);
$serialized = serialize($obj);
@hugeval
hugeval / bash
Created August 3, 2015 14:17
git-remote
git clone git@github.com:laboro/platform.git && cd platform
git remote add sso git@github.com:nenadalm/platform.git
git fetch sso
git checkout -b test_sso
git merge sso/google_sso
git push origin test_sso
PHP 374. Oro\Bundle\WorkflowBundle\EventListener\ProcessCollectorListener->postFlush() /home/hugeval/projects/oro/008-ee-dev/app/cache/dev/appDevDebugProjectContainer.php:71922
PHP 375. Oro\Bundle\WorkflowBundle\Model\ProcessHandler->handleTrigger() /home/hugeval/projects/oro/008-ee-dev/src/Oro/src/Oro/Bundle/WorkflowBundle/EventListener/ProcessCollectorListener.php:311
PHP 376. Oro\Bundle\WorkflowBundle\Model\Process->execute() /home/hugeval/projects/oro/008-ee-dev/src/Oro/src/Oro/Bundle/WorkflowBundle/Model/ProcessHandler.php:62
PHP 377. Oro\Bundle\WorkflowBundle\Model\Action\AbstractAction->execute() /home/hugeval/projects/oro/008-ee-dev/src/Oro/src/Oro/Bundle/WorkflowBundle/Model/Process.php:50
PHP 378. Oro\Bundle\WorkflowBundle\Model\Action\TreeExecutor->executeAction() /home/hugeval/projects/oro/008-ee-dev/src/Oro/src/Oro/Bundle/WorkflowBundle/Model/Action/AbstractAction.php:66
PHP 379. Oro\Bundle\WorkflowBundle\Model\Action\AbstractAction->execute() /home/hugeval/projects/oro/008-ee-dev/src/Oro/src/Oro
@hugeval
hugeval / composer-example.json
Last active September 4, 2015 12:10
composer-example
{
"name": "oro/crm-enterprise-application",
"description": "The OroCRM Enterprise Application",
"homepage": "https://github.com/orocrm/crm-enterprise-application.git",
"license": "OSL-3.0",
"autoload": {
"psr-0": {
"": "src/"
}
},
@hugeval
hugeval / bad_practices.php
Last active November 6, 2015 09:42
bad_practices
<?php
// wrong
$entityConfig = new EntityConfigId('security', $entityClass);
$shareScopes = $this->configManager->getConfig($entityConfig)->get('share_scopes');
// correct
$shareScopes = $this->configManager->getProvider('security')->getConfig($entityClass)->get('share_scopes');
// or
$shareScopes = $this->securityConfigProvider->getConfig($entityClass)->get('share_scopes');
//
@hugeval
hugeval / git_submodules.bash
Created November 6, 2015 10:10
git submodule management
git submodule foreach bash -c 'git branch | grep -v \* | xargs git branch -D'
@hugeval
hugeval / git_revert_merge_commit.sh
Created November 17, 2015 11:18
git_revert_merge_commit.sh
git revert -m 1 0abf622 -n
Your application 'testdsh' is successfully deployed
Your application 'testdsh' is successfully deployed
Hello, dmitriy!
Application testdsh was successfully deployed to OroCloud.
Application URL: http://testdsh.trial.dev.oro-cloud.com
Application Username: testuser