Skip to content

Instantly share code, notes, and snippets.

@mwin007
mwin007 / Magento-Events-Observers
Last active November 3, 2015 06:45
Magento Events and Observers
Magento Events and Observers
By Manish Prakash in Magento, Nuts & Bolts
May 20 th, 2015
In this post we will see how magento manages events and observers.
Basics
Magento has a very powerful event/observer pattern which we can use very effectively in our custom modules. The basic principal of event/observer pattern is, certain events are fired/dispatched by magento through out its code base. These events have specific class objects attached as function parameters. Observers (class functions) can be setup which run when these events are fired and receive the class objects. The observer can manipulate, extract data from these class object and do additional processing required. So this help us to extend magento functionality without changing the magento core. So in practice it works like this, there are various events dispatched throughout magento using
1
Mage::dispatchEvent('controller_action_predispatch', array('controller_action' => $this));
@mwin007
mwin007 / developer-mode-extension-debug
Created November 5, 2015 08:23
Using debug extensions developer mode enough protectionUsing debug extensions developer mode enough protection
Using debug extensions / developer mode enough protection
up vote
15
down vote
favorite
There are some nice extensions for Magento developers that you usually do not want to have on a live system.
How can you keep them in the project repository but avoid them to be exposed on a live shop?
@mwin007
mwin007 / error-404-admin
Created November 8, 2015 06:10
Error 404 - Can't access backend after moving to new server on Magento
Error 404 - Can't access backend after moving to new server
up vote
0
down vote
favorite
1
I have moved my website on a new server (domain name is the same). Frontend is working properly but admin login page gives a 404 Not Found error.
Most posts about this issue suggest the solutions mentioned on this post Transferring Magento website, admin panel URL gives 404
@mwin007
mwin007 / angular-pagination.html
Created November 10, 2015 03:31 — forked from masudcsesust04/angular-pagination.html
Pagination with AngularJS for Typekit API
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Pagination with AngularJS - jsFiddle demo</title>
<script type='text/javascript' src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular-sanitize.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular-resource.js"></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
@mwin007
mwin007 / How To Install Magento on Ubuntu
Created November 20, 2015 13:53
How To Install Magento on Ubuntu 14.04
Home » Linux » How To Install Magento on Ubuntu 14.04
How To Install Magento on Ubuntu 14.04
r00t May 12, 2015
magento-logo
For those of you who didn’t know, Magento is one of the worlds most widely used applications for managing E-Commerce sites. Magento is fully customizable to meet the users requirements and allowing them to create and launch a fully functional online store in minutes. Magento employs the MySQL relational database management system, the PHP programming language, and elements of the Zend Framework.
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Magento in Ubuntu 14.04 server.
Install Magento on Ubuntu 14.04
@mwin007
mwin007 / How to Install and Configure Magento on Ubuntu 14.04
Created November 20, 2015 21:08
How to Install and Configure Magento on Ubuntu 14.04
How to Install and Configure Magento on Ubuntu 14.04
Dec 2, 2014 Applications
Introduction
Magento is the most popular content management system for e-commerce websites. It is used by small businesses and large enterprise companies alike, and can be enhanced by thousands of extensions and themes. Magento uses the MySQL database system, the PHP programming language, and parts of the Zend Framework.
In this tutorial, we will go over how to install Magento with an Apache web server on Ubuntu 14.04, including some common performance and security configurations along the way.
Prerequisites
Before you begin with this guide, there are a few steps that need to be completed first.
@mwin007
mwin007 / ubuntu-virtual-host
Created November 23, 2015 20:18
How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
Apr 22, 2014 Apache Ubuntu
Introduction
The Apache web server is the most popular way of serving web content on the internet. It accounts for more than half of all active websites on the internet and is extremely powerful and flexible.
Apache breaks its functionality and components into individual units that can be customized and configured independently. The basic unit that describes an individual site or domain is called a virtual host.
These designations allow the administrator to use one server to host multiple domains or sites off of a single interface or IP by using a matching mechanism. This is relevant to anyone looking to host more than one site off of a single VPS.

##php[world] Tutorial Attendee Guide ###Scaling Magento - Reaching Peak Performance

####When / Where Monday, November 17th 9:00AM-12:30PM Ash Grove B

####General Overview We will be talking about clustering Magento and using Vagrant with Digital Ocean to back the tutorial. Vagrant and

@mwin007
mwin007 / Rsync to AWS EC2 Using .PEM key
Created November 29, 2015 08:00
Rsync to AWS EC2 Using .PEM key
The standard AWS EC2 instances support using a .PEM key to log in, instead of a more common SSH username/password combination. If you want to use Rsync to transfer data from your local machine to an AWS EC2 instance you will need to change the Rsync command to be something like this:
1
rsync -rave "ssh -i PEMKEYFILE.pem" /path/to/local/files/* ec2-user@EC2_INSTANCE_HOSTNAME:/path/to/remote/files
For simplicities sake I ensured that I was in the directory where the .pem key was saved, but you can adjust the command to give the path to your key file.
Beyond this it's just like regular Rsync, so just follow the on-screen commands and you get secured file transfer between your local machine and your remote AWS EC2 instance
@mwin007
mwin007 / aws rsync directory
Created December 1, 2015 14:32
aws rsync directory
sudo rsync --delete -azvv -e "ssh -i /var/tmp/aws-key_113015.pem" [email protected]:/var/tmp/ /var/tmp