This file contains 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
# Magento | |
php bin/magento config:set dev/css/minify_files 0 --lock-env | |
php bin/magento config:set dev/css/merge_css_files 0 --lock-env | |
php bin/magento config:set dev/js/merge_files 0 --lock-env | |
php bin/magento config:set dev/js/enable_js_bundling 0 --lock-env | |
php bin/magento config:set dev/js/minify_files 0 --lock-env | |
php bin/magento config:set dev/template/minify_html 0 --lock-env | |
php bin/magento config:set dev/static/sign 0 --lock-env | |
php bin/magento config:set sales_email/general/async_sending 0 --lock-env | |
php bin/magento config:set payment/checkmo/active 1 --lock-env |
This file contains 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
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
This file contains 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
location /media/customer/ { deny all; } | |
location /media/import/ { deny all; } | |
location /magento_version { deny all; } | |
location /static { | |
expires max; | |
# Remove signature of the static files that is used to overcome the browser cache | |
location ~ ^/static/version { | |
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; |
This file contains 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
location ~ ^/google(.*).html { | |
alias /data/web/google-verification-files/google$1.html; | |
} |
This file contains 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
<?php | |
$tables = shell_exec('magerun2 db:query "SHOW TABLES"'); | |
$tables = array_filter(explode(PHP_EOL, $tables), function ($table) { | |
if (empty($table)) return false; | |
if (substr($table, -3) === '_cl') return false; | |
if (substr($table, -8) === '_replica') return false; | |
if (stripos($table, '_flat_') !== false) return false; | |
if (stripos($table, '_fulltext_') !== false) return false; | |
if (stripos($table, 'sequence_') !== false) return false; | |
return true; |
This file contains 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
<?php | |
if (!file_exists('dutch.txt')) { | |
shell_exec('wget -O dutch.txt https://github.com/OpenTaal/opentaal-wordlist/blob/master/wordlist.txt?raw=true'); | |
} | |
$dict = explode("\n", file_get_contents('dutch.txt')); | |
$blacklisted = ['echo', 'var', 'reviews', 'rating', 'all', 'item', 'int', 'details', 'helper', 'label', 'configurator', 'display', 'var', 'id', 'show', 'a', 'br', 'preview', 'as', 'index', 'content', 'import', 'h', 'am', 'the', 'filter', 'type', 'Google', 'source', 'file', 'x', 'y', 'field', 'html']; | |
$dict = array_diff($dict, $blacklisted); |
This file contains 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
<?php declare(strict_types=1); | |
namespace VirtualMeetup\ImageOptimization\Console\Command; | |
use Graze\ParallelProcess\Event\RunEvent; | |
use Graze\ParallelProcess\PriorityPool; | |
use Graze\ParallelProcess\RunInterface; | |
use Magento\Framework\Filesystem\DirectoryList; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Helper\ProgressBar; |
This file contains 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
<?php declare(strict_types=1); | |
namespace VirtualMeetup\SitemapCrawler\Console\Command; | |
use Graze\ParallelProcess\Event\RunEvent; | |
use Graze\ParallelProcess\PriorityPool; | |
use Graze\ParallelProcess\RunInterface; | |
use Magento\Framework\Filesystem\Driver\File; | |
use Magento\Framework\HTTP\Client\Curl; |
This file contains 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
<?php | |
/** | |
* Copyright © Magento, Inc. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
use Magento\Framework\App\Bootstrap; | |
use Magento\Framework\DB\Adapter\AdapterInterface; | |
use Magento\Framework\DB\Query\Generator; | |
use Magento\Framework\DB\Select\QueryModifierFactory; |
This file contains 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 | |
SHOP_URL=https://yourshop.url | |
ADMIN_USERNAME=yourusername | |
ADMIN_PASSWORD=yourpassword | |
BEARER=$(curl -XPOST -H 'Content-Type: application/json' ${SHOP_URL}/index.php/rest/V1/integration/admin/token -d '{ "username": "${ADMIN_USERNAME}", "password": "${ADMIN_PASSWORD}" }') | |
curl -XGET -H "Authorization: Bearer ${BEARER}" ${SHOP_URL}/rest/default/schema?services=all | tee swagger.json | |
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate -i /local/swagger.json -l php -o /local/ |