Skip to content

Instantly share code, notes, and snippets.

@arnaud-lb
arnaud-lb / pre-commit.sh
Created December 1, 2012 11:58 — forked from yangsu/pre-commit.sh
pre-commit git hook for crushing images
#!/bin/sh
# to use, save this file as .git/hooks/pre-commit in your git repo
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit
command -v pngcrush >/dev/null 2>&1 || {
echo "\033[1mPlease install pngcrush to reduce images size before commit\033[0m"
echo "Install pngcrush with the following:"
echo "\t \033[1mbrew install pngcrush\033[0m"
echo "OR"
echo "\t Site: \033[1m\033[4mhttp://pmt.sourceforge.net/pngcrush/\033[0m"
echo "\t Download: \033[1m\033[4mhttp://sourceforge.net/projects/pmt/files/\033[0m"
@arnaud-lb
arnaud-lb / gist:1382400
Created November 21, 2011 11:44 — forked from pierrejoye/gist:1382376
get_ vs reflection
<?php
class foo {
public $a = 1;
private $b = 2;
public $c = 3;
public $d = 4;
protected $e = 5;
public function methodA() {}