These set of scripts are for Magento 1. For Magento 2, see this Gist.
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
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
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
<? | |
/* | |
Title: | |
FoxyCart_Inventory | |
Description: | |
Uses FoxyCart.com's XML Data Feeds to modify Processwire data. | |
Version: |
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
#!/usr/bin/php | |
<?php | |
/** | |
* Copyright © 2015 Magento. All rights reserved. | |
* See https://github.com/magento/magento2/blob/develop/COPYING.txt for license details. | |
*/ | |
/** | |
* validate_m2_package.php - a script that checks a given M2 zip package to ensure | |
* it is structured correctly and has all the required files. |
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
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5 | |
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7 | |
CENTVER="6" | |
OPENSSL="openssl-1.1.0-pre5" | |
NGINX="nginx-1.11.0-1" | |
yum clean all | |
# Install epel packages (required for GeoIP-devel) |
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: | |
paths: ["app/code/{vendor-name-goes-here}/*", "vendor/{vendor-name-goes-here}/*"] | |
excluded_paths: | |
- "vendor/{vendor-name-goes-here}/{module-name-goes-here}/*" | |
- "app/code/{vendor-name-goes-here}/{module-name-goes-here}/*" | |
- '*.min.js' | |
before_commands: | |
tools: | |
php_code_sniffer: | |
config: { standard: 'Zend,PSR-1,PSR-2' } |
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
# Display the number of SKUs in a attribute set | |
SELECT eas.attribute_set_name, COUNT(cpe.sku) | |
FROM eav_attribute_set AS eas | |
LEFT JOIN catalog_product_entity AS cpe ON cpe.attribute_set_id = eas.attribute_set_id | |
WHERE entity_type_id = 4 | |
GROUP BY eas.attribute_set_name | |
# To see if an email to a user has been successfulyy sent in the sales_order table and sales_shipment table | |
SELECT s.email_sent AS "Shipment Email Sent", o.email_sent AS "Order Email Sent", s.order_id | |
FROM sales_shipment AS s |
Because Varnish doesn't support SSL, most people choose a setup where Nginx SSL will forward all traffic to Varnish and Varnish will forward will forward the traffic it cannot handle back to nginx. Or worse, bind Varnish on port 80 and direct all traffic into Varnish. This will already degrade performance, because Varnish will purge more because static files are also taking up room in the cache.
Next up, the Nginx configuration of Magento will handle static files.