Skip to content

Instantly share code, notes, and snippets.

<?php
$a = range(1,100);
while(count($a) > 1) {
$key = key($a);
unset($a[$key]);
if ( false === current($a) ) {
reset($a);
}
if ( false === next($a) ) {
@kkopachev
kkopachev / post-checkout
Created February 12, 2014 01:46
composer install post-checkout hook
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
GIT_DIR=$(git rev-parse --git-dir)