# This code snippet is runnable
# Download Elasticsearch zip
curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.zip
# Unzip to desired location
unzip elasticsearch-0.90.7.zip -d $HOME
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 | |
/** | |
* News List admin edit form image tab | |
* | |
* @author Magento | |
*/ | |
class Magentostudy_News_Block_Adminhtml_News_Edit_Tab_Image | |
extends Mage_Adminhtml_Block_Widget_Form | |
implements Mage_Adminhtml_Block_Widget_Tab_Interface | |
{ |
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
Regular expression cheat sheet for Varnish | |
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
regular expressions, for a complete guide, see: "man 7 regex" | |
Basic matching: | |
req.url ~ "searchterm" | |
True if req.url contains "searchterm" anywhere. | |
req.url == "searchterm" |
Recently had a client that wanted to customize the layout for a category landing page so that the category's title and description would be displayed above the layered navigation and product grid — essentially creating a full-width section above the left sidebar and main content areas.
NOTE: For reference, this is based off the blog post from Collaboration133.com's Magento - Add Custom Structural Block Reference.
I created a custom module to help organize and identify that there are some custom modifications to layout templates. Not saying you have to, but it may be easier for other's (or your future self) to recognize and find what customizations were done (and hopefully why).
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
server { | |
listen 80 default; | |
listen 443 ssl; | |
ssl_certificate PATHTOSSL.crt; | |
ssl_certificate_key PATHTOSSL.key; | |
server_name www.SITEURL.com *.SITEURL.com; ## Domain is here twice so server_name_in_redirect will favour the www | |
root PATH TO MAGENTO ROOT; | |
autoindex off; |
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
<?xml version="1.0"?> | |
<config> | |
<frontend> | |
<events> | |
<!-- disble logs --> | |
<controller_action_predispatch> | |
<observers><log><type>disabled</type></log></observers> | |
</controller_action_predispatch> | |
<controller_action_postdispatch> | |
<observers><log><type>disabled</type></log></observers> |
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
Create a new module and in config.xml do the follow: | |
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Company_Module> | |
<version>0.1.0</version> | |
</Company_Module> | |
</modules> | |
<adminhtml> |
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 | |
# Patch apllying tool template | |
# v0.1.2 | |
# (c) Copyright 2013. Magento Inc. | |
# | |
# DO NOT CHANGE ANY LINE IN THIS FILE. | |
# 1. Check required system tools | |
_check_installed_tools() { | |
local missed="" |
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
Core optimization I: | |
Test: | |
url: http://myproject.com.local/ (a catalog page that loads 111 products) | |
Before: | |
Total Incl. Wall Time (microsec): 34,340,233 microsecs | |
Number of Function Calls: 10,098,542 |
CLI utilities to clean the Magento media folders.
Features:
- Clean unused images from the product catalog.
- Clean the product catalog image cache.
- Ready to use: automatically reads settings from
app/etc/local.xml
- FAST: I used it to safely clean about 45,000 images in just a couple of minutes.