Skip to content

Instantly share code, notes, and snippets.

View grafikchaos's full-sized avatar

Josh J. grafikchaos

View GitHub Profile
@grafikchaos
grafikchaos / puma.sh
Created September 27, 2013 04:13 — forked from runlevel5/puma.sh
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
@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 / 01-README.md
Created October 26, 2016 20:52 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@grafikchaos
grafikchaos / macosx-install-php-oracle-oci8-pdo_oci.md
Created November 1, 2016 03:09 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew

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):

@grafikchaos
grafikchaos / Category_Attributes.sql
Last active June 18, 2019 09:43 — forked from ticean/Category.sql
Magento EAV SQL Queries
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-checkout-form-key.sh
Last active September 2, 2022 16:22 — forked from aadmathijssen/add-checkout-form-key.sh
Magento SUPEE-9767 Checkout Form Key Theme Patch
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 \