Skip to content

Instantly share code, notes, and snippets.

View inri13666's full-sized avatar

Nikita Makarov inri13666

View GitHub Profile
<?php
namespace HomeNest\Bundle\ThemeBundle\Security\Authorization\Voter;
use ED\BlogBundle\Security\Authorization\Voter\ArticleVoter as EdArticleVoter;
class OverriddenArticleVoter extends EdArticleVoter
{
public function supportsClass($class)
{
try {
<?php
/**
* @file
* API functions for processing and sending e-mail.
*/
/**
* Auto-detect appropriate line endings for e-mails.
*
public function testRebuildCache()
{
$translator = $this->getContainer()->get('translator.default');
$key = uniqid('TRANSLATION_KEY_', true);
$domain = LoadTranslations::TRANSLATION_KEY_DOMAIN;
$locale = LoadLanguages::LANGUAGE2;
$expectedValue = uniqid('TEST_VALUE_', true) . '';
$this->manager->saveValue($key, $expectedValue, $locale, $domain);
public function saveValue($key, $value, $locale, $domain = self::DEFAULT_DOMAIN, $scope = Translation::SCOPE_SYSTEM)
{
$translationValue = $this->findValue($key, $locale, $domain);
if (!$this->canUpdateTranslation($scope, $translationValue)) {
return null;
}
if (!$value && $translationValue) {
$this->getEntityManager(Translation::class)->remove($translationValue);
return null;
<% if(!stepFrom || stepFrom.get('name')) {
var stepFromName = stepFrom ? stepFrom.get('name') : '';
%>
<div class="control-group">
{{ _self.render_label("oro.workflow.form.from_step.label"|trans, true, "oro.workflow.workflowdefinition.transition.step_from.tooltip") }}
<div class="controls">
<select name="step_from" data-validation="{{ requiredConstraint|json_encode }}"
<% if (name && !_is_clone) { %>disabled="disabled"<% } %>
>
<option value=""></option>
@inri13666
inri13666 / DumpWorkflowDefinitionCommand.php
Last active October 7, 2016 15:48
Workflow extended commands
<?php
namespace Oro\Bundle\WorkflowBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Yaml;
@inri13666
inri13666 / app.cmd
Created November 7, 2016 17:08
Provides simply way to access Symfony's Console
@ECHO OFF
if exist "app/console" (
SET CONSOLE="app/console"
)
if exist "bin/console" (
SET CONSOLE="bin/console"
)
IF NOT DEFINED CONSOLE (
echo "No console found"
@inri13666
inri13666 / config.yml.dist
Last active November 19, 2016 20:03
Demo for "phrets-core"
akuma:
phrets:
crea: #KeyAsAttribute
base_uri: 'http://sample.data.crea.ca/'
username: 'CXLHfDVrziCfvwgCuL8nUahC'
password: 'mFqMsCSPdnb5WO1gpEEtDCHH'
http_auth_method: ~
user_agent: ~
+------------------+---------------------+------------------------+------------------------------------+----------+------+--+
| Province | Feed City | Google City | Google Neighbourhood | PostalC | Qnty | |
+------------------+---------------------+------------------------+------------------------------------+----------+------+--+
| Ontario | Brampton | Brampton | Churchville | L6Y4B5 | 13 | |
| Ontario | Toronto | Toronto | Willowdale | M2R1H9 | 39 | |
| Ontario | Toronto | Toronto | Midtown Toronto | M5R3T5 | 75 | |
| Ontario | Tiny | | Gilford | L0L1R0 | 4 | |
| Ontario | Lakeshore | | Belle River | N0R1A0 | 64 | |
| Ontario

####systeminfo | findstr /B /C:"OS Version" /C:"System Type" /C:"System Locale"

OS Version:                10.0.14393 N/A Build 14393
System Type:               x64-based PC
System Locale:             en-us;English (United States)

####php -i | findstr /B /C:"PHP Version" /C:"Architecture" /C:"Compiler" /C:"Configure Command" /C:"Zend Extension Build" /C:"Client API library version" /C:"PostgreSQL(libpq)"

PHP Version => 7.0.7