Skip to content

Instantly share code, notes, and snippets.

View roma-glushko's full-sized avatar
🦁

Roman Glushko roma-glushko

🦁
View GitHub Profile
@roma-glushko
roma-glushko / xdebug.bash
Created May 31, 2018 09:01
A bash script to toggle xdebug module
#!/bin/env bash
# Simple script to enable or disable the xdebug extension
case $1 in
on)
sudo sudo phpenmod xdebug
sudo service apache2 restart
echo "Xdebug is ON"
;;
@roma-glushko
roma-glushko / cache-warmup.sh
Created May 15, 2018 09:08 — forked from rogyar/cache-warmup.sh
Cache Warmup
wget -O - dev.mage2.com:1005/sitemap-1-1.xml | grep -E -o '<loc>.*</loc>' | sed -e 's/<loc>//g' -e 's/<\/loc>//g' > ~/sitemaps/mage2.txt
sudo siege -c100 -d5 -r1 -v -i -f ~/sitemaps/mage2.txt
<?php
namespace Vendor\Module\Test\Unit;
use Magento\Framework\App\ObjectManagerFactory as AppObjectManagerFactory;
use Magento\Framework\Config\File\ConfigFilePool;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Filesystem\DriverPool;
use Magento\Framework\Filesystem\Driver\File;
use Magento\Framework\App\Filesystem\DirectoryList;
@roma-glushko
roma-glushko / gist:399fd34235774ae24c35900471e2aa88
Last active April 14, 2016 11:51
Update product attribute of Magento 1.x
<?php
$allProductIds = Mage::getModel('catalog/product')->getCollection()->getAllIds();
$attributeCode = 'some_eav_attribute';
$attrData[$attributeCode] = 'some_value';
$storeId = 0;
Mage::getSingleton('catalog/resource_product_action')->updateAttributes($allProductIds, $attrData, $storeId);