Skip to content

Instantly share code, notes, and snippets.


Josh J. grafikchaos

View GitHub Profile

Running Puma on Nginx

I use the latest Puma v1.4.0 from rubygems.

Make sure you have nginx installed with these options:

>/opt/nginx/sbin/nginx -V
nginx version: nginx/1.0.15
built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) 
grafikchaos / gist:5906014
Last active Dec 19, 2015
phpenv debug outpu for phpenv install --releases
View gist:5906014
☠ AA-L-JOSHJ:.phpenv $ phpenv install --releases |dev ✔ |
+ [phpenv:33] '[' -z '' ']'
+ [phpenv:34] PHPENV_ROOT=/Users/jjohnson/.phpenv
+ [phpenv:38] export PHPENV_ROOT
+ [phpenv:40] '[' -z '' ']'
++ [phpenv:41] pwd
+ [phpenv:41] PHPENV_DIR=/Users/jjohnson/.phpenv
+ [phpenv:50] export PHPENV_DIR
+ [phpenv:53] shopt -s nullglob
++ [phpenv:55] abs_dirname /Users/jjohnson/.phpenv/bin/phpenv
grafikchaos / phplint_pre-commit
Last active Dec 18, 2015
example pre-commit hook to PHP lint the PHP files projects
View phplint_pre-commit
#!/usr/bin/env php
$output = array();
$return = 0;
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return);
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
exec("git diff-index --cached --name-only {$against}", $output);
grafikchaos / pre-commit
Last active Dec 18, 2015
example pre-commit hook to PHP lint the PHP files for Drupal projects
View pre-commit
#!/usr/bin/env php
$output = array();
$return = 0;
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return);
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
exec("git diff-index --cached --name-only {$against}", $output);
grafikchaos / AAI_Magento.gitignore
Created Jun 21, 2013
common gitignore file for our Magento projects
View AAI_Magento.gitignore
# Vagrant Boxes
# Magento Connect 2 cache directories and files
# Magento runtime media files
grafikchaos / Upgrading Magento via diff and
Last active Dec 18, 2015
Creating a diff file to upgrade Magento
View Upgrading Magento via diff and

Before you begin

Read Aaron Hawks' blog post for the original idea for this gist.

While this process should theoretically work to upgrade the core/default files that come with Magento from any old version to the most recent version (as long as they're in the same distribution, i.e., Community to Community or Enterprise to Enterprise), you should always refer to Magento's release notes and upgrade paths for the version you're upgrading to for full details and work flow. This is the process I used to go from Magento EE to Magento EE directly ( skipping over due to the instructions outlined in this Magento article and release notes ).

Upgrade Pre-Requisites

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


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 /
Last active Dec 14, 2015
Make unoconv apache's bitch

How to make unoconv run inside an apache instance: CHEAT

First, you should read this stackoverflow post

The instructions below are slightly modified to a specific project where we're converting every document to PDF

Create the /usr/local/bin/ file

grafikchaos / gist:4957527
Created Feb 14, 2013
Example of clearing data from an Apache Solr multicore installation
View gist:4957527
curl http://localhost:8484/solr/core0/update\?commit\=true -d '<delete><query>*:*</query></delete>'
grafikchaos / drupal7_search-api_geosearch-schema-3.6.xml
Last active Dec 13, 2015
Enable geosearching in Apache Solr and Drupal 7 search_api_solr module ( You'll need to copy/symlink both of these files to their respective filenames (i.e, schema.xml and solrconfig.xml)
View drupal7_search-api_geosearch-schema-3.6.xml
<?xml version="1.0" encoding="UTF-8" ?>
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
For more information, on how to customize this file, please see