Skip to content

Instantly share code, notes, and snippets.

View alexandr-parkhomenko's full-sized avatar

Oleksandr Parkhomenko alexandr-parkhomenko

  • ORO, Inc
  • Kyiv, Ukraine
View GitHub Profile
First update npm,
npm install -g npm stable
Then update node,
npm install -g node or npm install -g n
check after version installation,
Postgres allows the use of any existing database on the server as a template when creating a new database. I'm not sure whether pgAdmin gives you the option on the create database dialog but you should be able to execute the following in a query window if it doesn't:
CREATE DATABASE newdb WITH TEMPLATE originaldb OWNER dbuser;
Still, you may get:
ERROR: source database "originaldb" is being accessed by other users
To fix it you can use this query
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'originaldb' AND pid <> pg_backend_pid();
{
"oro_website_search" : {
"mappings" : {
"oro_product_2" : {
"_all" : {
"enabled" : false
},
"dynamic_templates" : [ {
"name_LOCALIZATION_ID" : {
"mapping" : {
# Fix timezone in php
date.timezone=UTC
memory_limit=2GB
short_open_tag=off
function getCredentials()
{
declare -A REQUIRED_CREDENTIALS
fields=(database_driver database_name database_user database_password)
for index in ${!fields[*]}
#mod_macro https://www.cri.ensmp.fr/~coelho/mod_macro/
<Macro VHostDev $baseDomain>
<VirtualHost *:80>
ServerName $baseDomain.dev
ServerAlias www.$baseDomain.dev
# Module mpm-itk
AssignUserID alexandr alexandr
DocumentRoot /home/alexandr/projects/dev/application/$baseDomain/web
@alexandr-parkhomenko
alexandr-parkhomenko / Test result
Created May 29, 2017 15:32
Array vs Object comparison
PHP: 7.1.2
1 mln records
-DTO-
Time: 0.26642107963562, Memory: 148MB
-Array with dynamic adding keys-
imports:
- ../../package/platform/src/Oro/Bundle/TestFrameworkBundle/Resources/config/behat.yml.dist
default: &default
gherkin:
filters:
tags: ~@not-automated&&~@skip&&~@community-edition-only
extensions:
Behat\MinkExtension:
browser_name: chrome
matrix:
include:
- php: 5.6
env: APPLICATION="application/commerce-crm-ee" TESTSUITE="unit"
- php: 7.0
env: APPLICATION="application/commerce-crm-ee" TESTSUITE="unit"
- php: 7.1
env: APPLICATION="application/commerce-crm-ee" TESTSUITE="unit"
- php: 7.1
alias cc="php -d xdebug.remote_enable=0 app/console cache:clear"
alias unitx="php -dxdebug.remote_autostart=1 /usr/local/bin/phpunit"
alias oroup="php app/console oro:install --user-name=admin --user-email=admin@example.com --user-firstname=John --user-lastname=Doe --user-password=admin --sample-data=n --organization-name=OroCRM --no-interaction --timeout 3600"
alias orocs="phpcs -p --encoding=utf-8 --extensions=php --standard=psr2 `git diff --name-only`"
<?php
$path = realpath('package/');
$directoryIterator = new RecursiveDirectoryIterator($path);
$iterator = new RecursiveIteratorIterator($directoryIterator);
$regexIterator = new RegexIterator(
$iterator,
'/^\/home\/ocz\/PhpstormProjects\/dev\/package\/.+\/Form\/Type.+Type.php$/',
RecursiveRegexIterator::GET_MATCH,