🏄♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
## PHP 7 Initial Compile ## | |
## Some help from the various places like these. ## | |
# http://www.zimuel.it/install-php-7/ | |
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu | |
## Setup Ubuntu 15.04/15.10 ## | |
# Other dependencies for PHP 7. Add any missing ones from configure script | |
# complaints, plus some LAMP needs too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default extension package | |
sudo apt-get install libxml2-dev libbz2-dev libmcrypt-dev libreadline-dev libxslt1-dev autoconf -y | |
# +apxs2 | |
sudo apt-get install apache2-dev -y | |
# +gd | |
sudo apt-get install -y libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libwebp-dev | |
# +opcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zend_extension=xdebug.so | |
xdebug.idekey = PHPSTORM | |
xdebug.remote_enable=1 | |
xdebug.remote_host="127.0.0.1" | |
xdebug.remote_port=9001 | |
xdebug.remote_autostart=0 | |
xdebug.remote_handler="dbgp" | |
xdebug.remote_mode="req" | |
xdebug.remote_connect_back=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Pavel Usachev <webcodekeeper@hotmail.com> | |
* @copyright Copyright (c) 2017, Pavel Usachev | |
*/ | |
'use strict'; | |
module.exports = function (grunt) { | |
// Project configuration. | |
grunt.initConfig({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Magento grunt tasks", | |
"version": "1.0.0", | |
"sp_simpleslider": "0.1.0", | |
"description": "", | |
"main": "Gruntfile.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Pavel Usachev", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- For table users, CREATE TABLE `users` (id int not null, name text); | |
--Without repeats | |
SELECT `id` FROM `users` GROUP BY `id` HAVING count(*)>1; | |
--With repeats | |
SELECT `id` FROM `users` WHERE `id` IN (SELECT `id` FROM `users` GROUP BY `id` HAVING count(*)>1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ubuntu-full-update="sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y" | |
alias docker-exec-php="docker exec -it devbox-php-fpm-1 sh" | |
alias docker-redis-clean="docker exec -it devbox-redis-1 redis-cli flushall" | |
alias docker-inspect-php="docker inspect devbox-php-fpm-1" | |
alias docker-kill-all="docker kill $(docker ps -aq)" | |
alias docker-stop-all="docker container stop $(docker container ls -aq)" | |
alias docker-rm-containers="docker container rm $(docker container ls -aq)" | |
alias docker-rm-images="docker rmi -f $(docker images -aq)" | |
alias docker-remove-all="docker rm $(docker ps -a -q)" | |
alias connect-ovpn-arc="sudo openvpn --config ~/Documents/openvpn.ovpn --daemon" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @var $productFactory \Magento\Catalog\Api\Data\ProductInterfaceFactory */ | |
/** @var $product \Magento\Catalog\Api\Data\ProductInterface */ | |
$product = $this->productFactory->create(); | |
$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE); | |
$product->setStatus(1); | |
$product->setVisibility(4); | |
$product->setCustomAttribute('tax_class_id', 0); // 0 - tax class none, 1 | |
$product->setCustomAttribute('website_ids', [1]); // 1 - default website |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory */ | |
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ | |
$collection = $this->collectionFactory->create(); | |
$collection->addAttributeToSelect('price'); | |
$collection->setOrder('price', 'DESC'); | |
$category = $this->registry->registry('current_category'); | |
if (!($category instanceof \Magento\Catalog\Model\Category)) { |
OlderNewer