Skip to content

Instantly share code, notes, and snippets.

View grafikchaos's full-sized avatar

Josh J. grafikchaos

View GitHub Profile
@grafikchaos
grafikchaos / README.md
Last active December 25, 2015 12:59
Fixes issue in Markshust_Uspsav with getting data back from the USPS Address Verification API caused by using 9-digit zipcode instead of splitting it into their expected 5-digit and 4-digit values.

Overview


UPDATE #2:

Added the getApiEndpoint() method and overrode the uspsSubmitRequest() method in the Helper/Data.php. Basically cheating like crazy to get the domain name and it's IP address so our server will use that instead of the humanized domain name. This is a bandaid approach specific to our client and their internal DNS issues, so I wouldn't suggest using that getApiEndpoint() method unless absolutely necessary.


@grafikchaos
grafikchaos / Cherry Picking Multiple Commits.md
Last active October 9, 2023 17:30
Cherry pick multiple commits from a remote or upstream branch
@grafikchaos
grafikchaos / gist:9938618
Last active July 22, 2016 14:38 — forked from petemcw/gist:1169053
Magento Snippets

Magento Snippets

Add Attribute Group and Attributes to Attribute Sets

In an install script, you can follow the below example:

<?php
/**
 * Pan_JewelryDesigner Extension
@grafikchaos
grafikchaos / Add SSH Keys.md
Last active October 21, 2018 17:00
Quickly add SSH Key to server
$ 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 / Magento - Add Custom Structure Blocks.md
Last active August 18, 2017 10:57
HowTo: Add Custom Structural Blocks to a Layout

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 November 29, 2023 07:49
Install IonCube on Linux

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

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@grafikchaos
grafikchaos / Magento_debug_controller_overrides.md
Last active July 10, 2019 16:10
Helpful debugging script for troubleshooting Magento overrides of controllers
// Post repeat directive for logging the rendering time
angular.module('myApp').directive('postRepeatDirective',
['$timeout',
function($timeout) {
return function(scope) {
if (scope.$first)
window.a = new Date(); // window.a can be updated anywhere if to reset counter at some action if ng-repeat is not getting started from $first
if (scope.$last)
$timeout(function(){
console.log("## DOM rendering list took: " + (new Date() - window.a) + " ms");
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache