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

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@amacgregor
amacgregor / dump-subset-of-magento-orders-and-customer-data.php
Created January 10, 2017 11:04 — forked from ceckoslab/dump-subset-of-magento-orders-and-customer-data.php
Proof of concept of script that does mysql dump of subset of Magento orders + related sales tables and customer's data of customer that did the orders. The script also attempts to import the data in local database. Currently the script gets last 1000 orders and customers data of customers that created the orders. Data anonymization is not implem…
<?php
$mysqlCommandPath = 'to be filled';
$mysqldumptCommandPath = 'to be filled';
$remoteDbUnsername = 'to be filled';
$remoteDbPassword = 'to be filled';
$remotePort = 'to be filled';
$remotHost = 'to be filled';
$remoteDb = 'to be filled';
@amacgregor
amacgregor / Dockerfile
Created May 15, 2016 11:21 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@amacgregor
amacgregor / config.xml
Last active December 16, 2015 13:39 — forked from anonymous/config
<?xml version="1.0"?>
<!--
/**
* @category Signifyd
* @package Signifyd_Connect
* @author Alex Manelis
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-->
<config>
@amacgregor
amacgregor / mageavcat.php
Created October 25, 2011 00:45 — forked from anonymous/mageavcat
Magento EAV Attribute for Category
INSERT INTO `eav_attribute` VALUES(132, 3, 'include_in_left_menu', NULL, NULL, 'int', NULL, NULL, 'select', 'Include in Left Navigation Menu', NULL, 'eav/entity_attribute_source_boolean', 0, 0, '1', 0, NULL);
<?php
$parentid = 3; //Parent category ID
$parentCat = Mage::getModel('catalog/category')->load($parentid);
$childCategories = explode(',',$parentCat->getChildren()); //Child category IDs separated by commas
?>
@amacgregor
amacgregor / Observer.php
Created October 13, 2011 16:35
checkout_cart_update_items_before
<?php
public function checkout_cart_update_items_before($observer)
{
$event = $observer->getEvent();
$products = $event->getInfo();
$customer = Mage::getSingleton('customer/session');
$items = $observer->getCart()->getQuote();
foreach($products as $key => $value){
$product = $items->getItemById($key);
<?php
/**
* Customerreviewimport.php
* CommerceExtensions @ InterSEC Solutions LLC.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: