Skip to content

Instantly share code, notes, and snippets.

View vovsky's full-sized avatar

Volodymyr Vygovskyi vovsky

View GitHub Profile
@vovsky
vovsky / README.md
Created March 5, 2017 18:20 — forked from jehaby/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@vovsky
vovsky / st1.md
Last active October 17, 2016 16:19
rm PATCH_SUPEE-8788_CE_1.9.2.4_v2-2016-10-14-09-42-47.sh PATCH_SUPEE-8788_CE_1.9.2.4_v2-2016-10-14-09-42-47.zip

git checkout skin/adminhtml/default/default/media/flex.swf skin/adminhtml/default/default/media/uploader.swf skin/adminhtml/default/default/media/uploaderSingle.swf

git fetch 
git merge SUPEE-8788
git push origin master
@vovsky
vovsky / install_latest_docker_compose.sh
Last active April 14, 2017 06:34 — forked from luislobo/install_latest_docker_compose.sh
Install Latest Docker and Docker-compose on Ubuntu, docker
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@vovsky
vovsky / exiftool.md
Last active May 30, 2017 15:26
exiftool
exiftool '-FileModifyDate<DateTimeOriginal' dir

Use the original date from the meta information to set the same file's filesystem modification date for all images in a directory. (Note that -TagsFromFile @ is assumed if no other -TagsFromFile is specified when redirecting information as in this example.)

exiftool -FileModifyDate+=2:00 -if '$filetype eq "MP4"' .
@vovsky
vovsky / local.xml
Created January 5, 2015 16:22
way to set template based on category
<?xml version="1.0"?>
<layout version="0.1.0">
<CATEGORY_40>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</CATEGORY_40>
</layout>
@vovsky
vovsky / urls.md
Last active August 29, 2015 14:09
magento, url, rewrite

How product Url is generated

On product list page to get product urls Magento performs the following query to assign request_path to every item in product collection:

SELECT
  `e`.`entity_id`                                           AS `product_id`,
  IFNULL(url_rewrite.request_path, default_ur.request_path) AS `request_path`
FROM `catalog_product_entity` AS `e`
  LEFT JOIN `enterprise_catalog_product_rewrite` AS `url_rewrite_product`
    ON url_rewrite_product.product_id = e.entity_id AND url_rewrite_product.store_id = 1
 LEFT JOIN `enterprise_url_rewrite` AS `url_rewrite`
@vovsky
vovsky / collation.php
Created April 28, 2014 14:25
changing collation script
<?php
require_once 'abstract.php';
class Atwix_Collation_Shell extends Mage_Shell_Abstract
{
/**
* Validate arguments
*
*/
protected function _validate()
@vovsky
vovsky / Observer.php
Created April 3, 2014 14:41
example of sorting collection by multiple columns
<?php
/**
* Atwix
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: