Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
@amacgregor
amacgregor / localhost.com.conf
Created March 5, 2015 12:18
Example vhost file for docker
Use VHost-PHP5.4 localhost.com * 80 localhost.com
@amacgregor
amacgregor / Dockerfile
Created March 5, 2015 12:12
Example usage of amacgregor/base docker image
FROM amacgregor/base
MAINTAINER Allan MacGregor <[email protected]>
RUN mkdir -p /srv/www/
COPY config/vhosts/ /etc/apache2/sites-available
RUN a2ensite localhost.com.conf
<?php
class Mage_Adminhtml_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
// echo $_product->getResource()->getAttribute('attribute name')->getFrontend()->getValue($_product)
public function __construct()
{
<?php
class NotificationManager {
public function sendNotification(NotificationInterface $notification, $data)
{
$notification->setData($data);
$notification->sendNotification();
}
}
<?php
class NotificationManager {
public function sendNotification($type = '', $data)
{
switch($type){
case "email":
$notification = new EmailAdapter();
break;
<?php
interface NotificationInterface {
public function setData($data);
public function sendNotification();
}
class TwitterAdapter implements NotificationInterface
{
protected $_data;
<?php
interface NotificationInterface {
public function setData($data);
public function sendNotification();
}
<?php
class NotificationManager {
public function sendNotification($type = '', $data)
{
switch($type){
case "email":
$notification = new EmailService();
$notification->setTo($data['to']);
/**
* Retrieve Customer instance
*
* @return \Magento\Customer\Api\Data\CustomerInterface
*/
public function getCustomer()
{
if (is_null($this->_customer)) {
$params = $this->urlDecoder->decode($this->_getRequest()->getParam('data'));
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
namespace Magento\Wishlist\Helper;
class Rss extends \Magento\Wishlist\Helper\Data
{
/**