Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh J. grafikchaos

View GitHub Profile
@grafikchaos
grafikchaos / Cherry Picking Multiple Commits.md
Last active Sep 7, 2020
Cherry pick multiple commits from a remote or upstream branch
View Cherry Picking Multiple Commits.md
@grafikchaos
grafikchaos / Magento_debug_controller_overrides.md
Last active Jul 10, 2019
Helpful debugging script for troubleshooting Magento overrides of controllers
View Magento_debug_controller_overrides.md
@grafikchaos
grafikchaos / Category_Attributes.sql
Last active Jun 18, 2019 — forked from ticean/Category.sql
Magento EAV SQL Queries
View Category_Attributes.sql
SET @entityid = 5; -- category's ID
-- Select varchar/string based category attribute values
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav ON e.entity_id = eav.entity_id
JOIN eav_attribute ea ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
-- Select integer based category attribute values (includes boolean values)
UNION(
@grafikchaos
grafikchaos / Add SSH Keys.md
Last active Oct 21, 2018
Quickly add SSH Key to server
View Add SSH Keys.md
$ cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys"
@grafikchaos
grafikchaos / magento2-installation-via-command-line.md
Last active Aug 23, 2018
Magento 2 Installation via command line
View magento2-installation-via-command-line.md

Install Magento 2 Community Edition (CE)

Via Composer

You can use the Magento integrator instructions to install download/install Magento 2 via composer

Get the Magento CE metapackage

To get started:

View Migrate SVN repo to Git and incorporate git-flow work process.md

Overview

This is the process I have found to be very helpful when migrating projects from their SVN repository over to Git. When migrating from one version control system to another it's important to retain as much information about the development history as possible (i.e., commit messages, tags, branches, etc.) and avoid the easy and tempting method of just downloading the project from a server and throw it into the new version control (you should only consider that if the project has never been in a version control system before).

Key concepts:

  • tools for migrating svn repositories to git
  • how to migrate standardized svn repositories
  • how to migrate non-standardized svn repositories
  • best practices for your now un-maintained SVN repository
@grafikchaos
grafikchaos / add-checkout-form-key.sh
Last active Sep 26, 2017 — forked from aadmathijssen/add-checkout-form-key.sh
Magento SUPEE-9767 Checkout Form Key Theme Patch
View add-checkout-form-key.sh
find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' \
| xargs grep -L formkey \
| xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?>\n<\/form>/g'
find -L skin/frontend -name 'opcheckout.js' \
| xargs grep -L form_key \
| xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) \{/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
find -L js -name 'payment.js' \
| xargs grep -L form_key \
@grafikchaos
grafikchaos / Magento - Add Custom Structure Blocks.md
Last active Aug 18, 2017
HowTo: Add Custom Structural Blocks to a Layout
View Magento - Add Custom Structure Blocks.md

Overview

Recently had a client that wanted to customize the layout for a category landing page so that the category's title and description would be displayed above the layered navigation and product grid — essentially creating a full-width section above the left sidebar and main content areas.

NOTE: For reference, this is based off the blog post from Collaboration133.com's Magento - Add Custom Structural Block Reference.

Custom Module (My_LayoutMods)

I created a custom module to help organize and identify that there are some custom modifications to layout templates. Not saying you have to, but it may be easier for other's (or your future self) to recognize and find what customizations were done (and hopefully why).

@grafikchaos
grafikchaos / Install_IonCube_Loaders.md
Last active Aug 9, 2017
Install IonCube on Linux
View Install_IonCube_Loaders.md

Overview

I always forget the steps, but it's pretty simple:

Steps:

  • Download the IonCube Loaders
  • Check your PHP version to find which IonCube loader you should use
  • Check your PHP configuration for the extension_dir
  • Copy the IonCube Loader into the PHP extension directory
View macosx-install-php-oracle-oci8-pdo_oci.md

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):