Skip to content

Instantly share code, notes, and snippets.

@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@scottsb
scottsb / m2-cache-cheat-sheet.md
Last active February 22, 2024 14:56
Magento 2 Cache Cheat Sheet

Magento 2 Cache Cheat Sheet

This page lists what caches or directories you will need to clear to apply various types of changes. It is consolidated and adapted from the complete official documentation on directories and caches.

💁 If your development environment supports it, you are better off using Vinai's automatic cache cleaner. As of this writing, the primary reason why it might not work is if your code is hosted on a NFS share (common with Vagrant).

@schmengler
schmengler / add-checkout-form-key.sh
Last active September 2, 2022 16:23
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -regex '.*\(shipping\|billing\|shipping_method\|payment\).phtml' -exec grep -L formkey {} \; \
| xargs sed -i 's/<\/form>/<?php echo $this->getBlockHtml("formkey") ?><\/form>/g'
find -L skin/frontend -name 'opcheckout.js' -exec grep -L form_key {} \; \
| xargs sed -i 's/if (elements\[i\].name=='\''payment\[method\]'\'') {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
@eduncan911
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@ryaan-anthony
ryaan-anthony / curl.out
Created December 17, 2015 15:20
Using CURL to make SOAP requests with Magento 1.x
$ cat login.xml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<MAGE:login xmlns:MAGE="http://xxxxxx/api/v2_soap/?wsdl=1">
<MAGE:username>xxxxxx</MAGE:username>
<MAGE:apiKey>xxxxxx</MAGE:apiKey>
</MAGE:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
$ curl --data @login.xml http://xxxxxx/api/v2_soap
@dannguyen
dannguyen / wget-snapshotpage.md
Last active December 25, 2023 20:57
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@davefreiman
davefreiman / rewrites_output
Created April 19, 2015 19:46
Output of script that scanned ~6000 Magento Connect extensions for all their listed rewrites - with help from triplecheck.io
{
"blocks":{
"sales_order_grid":110,
"sales_order_view":67,
"html_head":55,
"comment":51,
"catalog_product_grid":38,
"product_view":34,
"onepage":32,
"onepage_payment_methods":30,
@lukaskuzmiak
lukaskuzmiak / php_xxe_tester.php
Created August 20, 2014 00:45
PHP XXE tester
<?php
// Extended tester from ezimuel (https://gist.github.com/ezimuel/9135151)
// The libxml entity loader is disabled by default
// even setting the libxml_disable_entity_loader to false doesn't works!
//
// @see http://uk3.php.net/manual/en/function.libxml-disable-entity-loader.php
// @see http://stackoverflow.com/a/10213239
// @see https://stackoverflow.com/questions/24117700
$dir = __DIR__;
@tegansnyder
tegansnyder / Magento-Solr-Setup-Guide.md
Last active December 3, 2018 15:08
SOLR setup script for Magento multi-core using default Jetty servlet

This guide assumes you are on Centos or a Redhat / Fedora system.

install Java JDK

sudo yum remove java
sudo yum install java-1.7.0-openjdk
sudo yum install java-1.7.0-openjdk-devel

# download Solr
cd ~/
@nicolashery
nicolashery / solarized-dark.css
Last active March 25, 2022 08:38 — forked from scotu/solarized.css
Solarized theme stylesheets for Jekyll and Pygments
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content