Skip to content

Instantly share code, notes, and snippets.

View Stepa4man's full-sized avatar

Stepan Furman Stepa4man

  • TechDivision
  • Germany
View GitHub Profile
@Stepa4man
Stepa4man / promises.js
Created December 9, 2021 13:30
Promises work like that
function change()
{
if (window.promise_test) {
window.promise_test.then(() => console.log('Second message'));
} else {
window.promise_test = new Promise(
function (resolve, reject) {
console.log('Show first message');
setTimeout(
() => {
@Stepa4man
Stepa4man / update.txt
Created October 20, 2018 21:15
Update Magento
composer require magento/product-community-edition 2.2.5 --no-update
;/etc/php/7.1/fpm/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"
@Stepa4man
Stepa4man / hostname.conf
Last active October 16, 2018 10:02
Nginx dev config
#/etc/nginx/sites-available/hostname.conf
#/etc/nginx/sites-enabled/hostname.conf <- symblink
server {
listen 80;
server_name mage22-sd.loc;
set $MAGE_ROOT /home/sfurman/devilbox/data/www/hostname;
set $MAGE_MODE developer;
include /home/sfurman/devilbox/data/www/hostname/nginx.dev.conf;
}
@Stepa4man
Stepa4man / customer-data-update.txt
Last active October 15, 2018 19:52
Update customer data block in browser console
require('Magento_Customer/js/customer-data').reload(['cart'], false)
@Stepa4man
Stepa4man / reinstall-project.sh
Last active September 25, 2018 09:47
Reinstall project
#!/bin/sh
echo Please provide url name:
read name
echo Please provide db name:
read dbname
rm -f ./app/etc/config.php ./app/etc/env.php ./pub/static/deployed_version.txt;
rm -rf ./generated/code/ ./generated/metadata/ ./var/page_cache \
./pub/static/frontend/ ./pub/static/adminhtml/ ./var/cache ./var/view_preprocessed/;
@Stepa4man
Stepa4man / install-project.sh
Created September 25, 2018 09:42
Install new project
#!/bin/sh
echo Please provide git repo:
read git
echo Please provide url name:
read name
echo Please provide db name:
read dbname
git clone $git;
@Stepa4man
Stepa4man / catalog-urn-build.txt
Last active October 15, 2018 19:53
.idea/misc.xml
bin/magento dev:urn-catalog:generate .idea/misc.xml
@Stepa4man
Stepa4man / magento1-custom-script.php
Last active October 15, 2018 19:53
Magento 1 script temaplte
<?php
set_time_limit(0);
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once './app/Mage.php';
Mage::setIsDeveloperMode(true);
Mage::app();
'queue' =>
array (
'amqp' =>
array (
'host' => '0.0.0.0',
'port' => '5672',
'user' => 'guest',
'password' => 'guest',
'virtualhost' => '/',
),