Skip to content

Instantly share code, notes, and snippets.

View rodde177's full-sized avatar

rodde177

  • sthlm
View GitHub Profile
@lepfhty
lepfhty / elasticsearch-mongo-install.md
Last active June 5, 2016 19:13
Install Elasticsearch and MongoDB with river on Mac OSX.

Install Elasticsearch with Service Wrapper

# 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
@xcommerce-gists
xcommerce-gists / Image.php
Created January 25, 2014 15:49
Sample Magento administrative image edit tab page
<?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
{
@dimsemenov
dimsemenov / vcl-regex-cheat-sheet
Last active March 12, 2022 19:01
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
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"
@grafikchaos
grafikchaos / Magento - Add Custom Structure Blocks.md
Last active August 18, 2017 10:57
HowTo: Add Custom Structural Blocks to a Layout

Overview

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.

Custom Module (My_LayoutMods)

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).

@nzajt
nzajt / magenot-host.conf
Created July 2, 2014 22:03
Magento Nginx host file
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;
@molotovbliss
molotovbliss / gist:c36c25b7a08afda2848b
Last active November 16, 2016 02:20 — forked from magentogirl/gist:e8dc6aa7c74d021f85cc
Disable Magento Logging observers & unused Core Modules via XML
<?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>
@rodrigowebjump
rodrigowebjump / Enable pdf extension in Magento Wysiwyg CMS
Created August 25, 2014 22:31
Enable pdf extension in Magento Wysiwyg CMS.
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>
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 5, 2014 20:18
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/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=""
@manelio
manelio / gist:5791101c513bf2d5d531
Created November 12, 2014 11:40
Magento performance: getSortedAttributes caching
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
@gsomoza
gsomoza / README.md
Last active May 14, 2020 10:09
Magento CLI Media Cleaner

Magento CLI Media Cleaner

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.