Skip to content

Instantly share code, notes, and snippets.

View dfelton's full-sized avatar

Darren Felton dfelton

View GitHub Profile
@dfelton
dfelton / .bashrc
Last active November 2, 2020 00:17
~/.bashrc preferences
# Git
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\u@\[\033[32m\]\w\[\033[33m\]\$(git_branch)\[\033[00m\]\$ "
# Aliases
alias la='ls -la'
@ProcessEight
ProcessEight / Anatomy of Magento 2: Layered Navigation.md
Last active April 17, 2025 17:29
In-depth exploration of how layered navigation is implemented in Magento 2

Anatomy of Magento 2: Layered Navigation

Points for investigation

  • Generate high-level overview of all the main components
  • How are the total item counts for each option generated?
  • How is the catalog updated to display the matching products?
  • How are options rendered?
  • What are the customisation points?
  • What events are dispatched?
@epcim
epcim / update-ca-certificates.md
Last active March 14, 2025 17:32
trusted certificates system update-ca-certificates

Adding trusted root certificates to the server

Mac OS X

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt
sudo security delete-certificate -c "<name of existing certificate>"

Windows

certutil -addstore -f "ROOT" new-root-certificate.crt

@dfelton
dfelton / Magento 1.x Orphaned Records Cleanup.md
Last active May 24, 2021 19:23
Deletes orphaned records from a Magento 1.x database.

Purpose

The purpose of this SQL script is to clean up a Magento 1.x database by deleting orphaned records from database tables which cause foreign key contraint failures. This happens when at some point in time records where deleted from the database while FOREIGN_KEY_CHECKS = 0 and the person performing the delete operations failed to delete all related records pertaining to related tables of the primary table.

This script can be helpful when encountering foreign key constraint failures using the Data Migration Tool to migrate your

@gnuWatchesU
gnuWatchesU / magento_copy.sh
Last active August 2, 2016 19:54
Copy magento database omitting unneeded tables
grep CDATA <srcdom>/httpdocs/shop/app/etc/local.xml
grep CDATA <dstdom>/httpdocs/shop/app/etc/local.xml
mysqldump -u <srcdb> -p --no-data -h <dbhost> <srcdb> | mysql -u <dstdb> -p -h <dbhost> <dstdb>
mysqldump -u <srcdb> -p --ignore-table=<srcdb>.dataflow_batch_export --ignore-table=<srcdb>.dataflow_batch_import --ignore-table=<srcdb>.log_customer --ignore-table=<srcdb>.log_quote --ignore-table=<srcdb>.log_summary --ignore-table=<srcdb>.log_summary_type --ignore-table=<srcdb>.log_url --ignore-table=<srcdb>.log_url_info --ignore-table=<srcdb>.log_visitor --ignore-table=<srcdb>.log_visitor_info --ignore-table=<srcdb>.log_visitor_online --ignore-table=<srcdb>.report_viewed_product_index --ignore-table=<srcdb>.report_compared_product_index --ignore-table=<srcdb>.report_event -h <dbhost> <srcdb> | mysql -u <dstdb> -p -h <dbhost> <dstdb>
@dfelton
dfelton / 000 - Magento Installer Script Quick Reference Guide.md
Last active September 16, 2019 19:51
Magento - Quick Reference Guide for creating new attributes via an installer script for EAV and flat table entity types.
@dfelton
dfelton / 000 - Magento SQL Snippets.md
Last active November 22, 2021 15:15
Useful SQL snippets for a Magento store.

Numerous SQL snippets to reference for pulling data straight from Magento's database.

All SQL snippets assume there is no database table name prefix configured. In the event that your database does have a table nameprefix, you should be able to simply update the original table names found in the "FROM" and "LEFT JOIN" declarations. All table names are aliased therefore a full revision of the SQL snippets would not be necessary.

@dfelton
dfelton / 000 - sync.md
Last active August 30, 2016 15:37
Magento - Syncs a live DB into a development db and updates Magento's base URLs to a localhost URL

Scripts for synching a development Magento database database with it's live counterpart.

@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@bhcopeland
bhcopeland / require_updated_git_branch.py
Created December 11, 2014 09:23
ansible callback_plugin to check that the locally git directory is up to date/in sync.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import subprocess
import sys
from ansible.callbacks import display, banner