Skip to content

Instantly share code, notes, and snippets.

View grafikchaos's full-sized avatar

Josh J. grafikchaos

View GitHub Profile
@grafikchaos
grafikchaos / phplint_pre-commit
Last active December 18, 2015 19:29
example pre-commit hook to PHP lint the PHP files projects
#!/usr/bin/env php
<?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
grafikchaos / pre-commit
Last active December 18, 2015 18:59
example pre-commit hook to PHP lint the PHP files for Drupal projects
#!/usr/bin/env php
<?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
grafikchaos / AAI_Magento.gitignore
Created June 21, 2013 06:15
common gitignore file for our Magento projects
# Vagrant Boxes
.vagrant
# Magento Connect 2 cache directories and files
downloader/pearlib/cache/
downloader/*.cfg
downloader/.cache/
# Magento runtime media files
media/catalog/product/cache/
@grafikchaos
grafikchaos / Upgrading Magento via diff and patch.md
Last active December 18, 2015 04:38
Creating a diff file to upgrade Magento

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 1.12.0.2 to Magento EE 1.13.0.1 directly ( skipping over 1.13.0.0 due to the instructions outlined in this Magento article and release notes ).


Upgrade Pre-Requisites

@grafikchaos
grafikchaos / README.md
Last active December 14, 2015 01:58
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/unoconv.sh file

@grafikchaos
grafikchaos / gist:4957527
Created February 14, 2013 23:59
Example of clearing data from an Apache Solr multicore installation
curl http://localhost:8484/solr/core0/update\?commit\=true -d '<delete><query>*:*</query></delete>'
@grafikchaos
grafikchaos / drupal7_search-api_geosearch-schema-3.6.xml
Last active December 13, 2015 17:38
Enable geosearching in Apache Solr and Drupal 7 search_api_solr module (http://drupal.org/project/search_api_solr) You'll need to copy/symlink both of these files to their respective filenames (i.e, schema.xml and solrconfig.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
http://wiki.apache.org/solr/SchemaXml
@grafikchaos
grafikchaos / aliases.zsh
Created February 7, 2013 23:06
oh-my-zsh aliases plugin for common aliases I use
# ~/.oh-my-zsh/custom/aliases.zsh
# At the end of the file you can add the aliases from above
# or any other ones you find useful
alias ..='cd ..'
alias ll='ls -alGhF'
alias install='sudo apt-get install'
alias upgrade='sudo apt-get upgrade'
alias update='sudo apt-get update'
alias search='sudo apt-cache search -n'
@grafikchaos
grafikchaos / InstallingGitUsingYum.md
Created October 17, 2012 21:07 — forked from eddarmitage/InstallingGitUsingYum.md
Installing git on CentOS 5 using yum

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

@grafikchaos
grafikchaos / gist:3185895
Created July 27, 2012 02:36 — forked from olistik/gist:2627011
Ubuntu 12.04 setup (rbenv, janus, postgres)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git
  • Copy/paste from the command line:
sudo apt-get install xclip