Skip to content

Instantly share code, notes, and snippets.

View dgitman's full-sized avatar

David Gitman dgitman

View GitHub Profile
@Vinai
Vinai / magento-composer-issues.md
Last active April 15, 2020 03:09
My beef with composer and Magento
@georanma
georanma / Dockerfile
Created March 20, 2019 20:34
Docker Magento 1 w/ Xdebug
FROM php:7.2-fpm
RUN apt-get -qq update && apt-get -qq install libxml++2.6-dev > /dev/null
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
zlib1g-dev \
libicu-dev \
g++ \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@veuncent
veuncent / aws_glacier_delete_vault.md
Last active March 19, 2024 18:16
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@vasanthk
vasanthk / System Design.md
Last active April 24, 2024 17:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mpchadwick
mpchadwick / Mpchadwick_Missing_Acl_Checker.php
Created July 11, 2015 03:42
Mpchadwick_Missing_Acl_Checker.php
<?php
require_once 'abstract.php';
/**
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
*/
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
{
const MODULES_PATH = 'modules';
@jasontipton
jasontipton / local.xml
Created November 13, 2014 20:06
Magento Local.xml NOINDEX/NOFOLLOW Catalog Search
<?xml version="1.0"?>
<layout version="0.1.0">
<!-- Search Results page -->
<catalogsearch_result_index>
<reference name="head">
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action>
</reference>
</catalogsearch_result_index>
@Gabelbombe
Gabelbombe / repeat-vs-firsttime.sql
Last active February 1, 2016 17:40
Magento: Customer Segmentation Reports (Repeat vs. First Time Buyers) in Donut Chart format (http://goo.gl/4MoAh0)
#################################################################
#################################################################
# ○ The number and percentage of customers who placed an order #
# ○ VS. number and percentage of repeat customer orders #
# #
# +------------------+-------+------------+ #
# | Type | Count | Percentage | #
# +------------------+-------+------------+ #
# | Total Customers | 35 | 100.0% | #
# | Single Customers | 1 | 2.9% | #
@erfanimani
erfanimani / .gitignore
Last active June 1, 2019 10:22
A refactored and modern .gitignore for Magento. Compatible for Git versions 2.7.0+. See this revision to use it for versions lower than 2.7.0: https://gist.github.com/erfanimani/8856964/886f5d79d229c21b9c712155c362e5fc1c61a12a
### MAGENTO DIRECTORIES
# Ignore everything in media, except for the htaccess files
# Also include the Lazy Catalog Images (LCI) .htaccess if that's installed
# (https://github.com/AOEpeople/Aoe_LazyCatalogImages)
/media/*
!/media/.htaccess
!/media/customer/.htaccess
!/media/downloadable/.htaccess
!/media/catalog/product/LCI/.htaccess
@ryaan-anthony
ryaan-anthony / gist:8289750
Created January 6, 2014 21:00
create the following procedure, then to call it: type "call sort_categories;" in mysql.
delimiter ;;
drop procedure if exists sort_categories;;
create procedure sort_categories()
begin
DECLARE cur_id BIGINT UNSIGNED;
DECLARE cur_eof INT DEFAULT FALSE;
DECLARE cur CURSOR FOR
SELECT entity_id
FROM catalog_category_entity_varchar
WHERE attribute_id = (