Skip to content

Instantly share code, notes, and snippets.

View nedmas's full-sized avatar

Tom Densham nedmas

View GitHub Profile
@nedmas
nedmas / local.xml
Created May 30, 2012 13:58
Magento Snippet - Set the Catalog Product Grid column count
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_category_default translate="label">
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setColumnCount"><columns>4</columns></action>
</block>
</block>
</reference>
@nedmas
nedmas / gist:2708724
Created May 16, 2012 08:35
A simple script to create directory hierarchies
#!/bin/bash
CONFIGDIR="$HOME/.skeleton"
WORKINGDIR=$(pwd)
if [ $# -lt 1 ]
then
echo "Usage : $0 [pattern]"
exit
fi
@nedmas
nedmas / .gitignore
Created November 10, 2011 16:18
Git Global Ignore List
.DS_Store
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# It's better to unpack these files and commit the raw source because
@nedmas
nedmas / .gitconfig
Created November 10, 2011 16:18
Git Global Configuration
[user]
name = Tom Densham
email = [email protected]
[core]
quotepath = false
excludesfile = /Users/tomdensham/.gitignore
[mergetool]
keepBackup = true
[alias]
l50 = "!git log --abbrev-commit --date=short --pretty=format:'%x00%h%x00%cd%x00%s%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-50s \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, $3, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$4), $5, $6 }' | less -R"
@nedmas
nedmas / .bash_profile
Created November 10, 2011 16:16
Mac OS X Bash Profile
export PATH=~/bin:$PATH
export CLICOLOR=1
export LSCOLORS='Axfxcxdxbxegedabagacad'
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
else
@nedmas
nedmas / gist:1287451
Created October 14, 2011 15:40
Just a simple bash script for adding new sites on an apache server
#!/bin/bash
while getopts ":h:p:a:d:l:" opt; do
case $opt in
h)
HOST="$OPTARG"
;;
p)
PORT="$OPTARG"
;;