🏄♂️
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 | |
if [ "$MAGENTO_VERSION" != false ] | |
then | |
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition:${MAGENTO_VERSION} . | |
else | |
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition . | |
fi | |
mkdir -p ./var/composer_home/ |
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
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition . | |
php -dmemory_limit=-1 bin/magento setup:install --base-url=http://127.0.0.1/magento2/ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US | |
php -dmemory_limit=-1 bin/magento sampledata:deploy && php -dmemory_limit=-1 bin/magento setup:upgrade |
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)) { |
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
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
-- 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
{ | |
"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
/** | |
* @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
#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
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 |