Skip to content

Instantly share code, notes, and snippets.

View pdt256's full-sized avatar

Jamie Isaacs pdt256

View GitHub Profile
### Keybase proof
I hereby claim:
* I am pdt256 on github.
* I am pdt256 (https://keybase.io/pdt256) on keybase.
* I have a public key ASBrAG7Qlw1I_IRWVcziZjByzxVzFoojqxjsMSZMr3ybuAo
To claim this, I am signing this object:
<?php
namespace path\to\Lib;
use Doctrine;
use path\to\Doctrine\Extensions\TablePrefix;
class DoctrineHelper
{
protected $tablePrefix = 'yourprefix_';
protected $eventManager;
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@pdt256
pdt256 / gist:8410994
Created January 14, 2014 00:48
Convert multiple jpg images to single pdf in grayscale
convert *.jpg -quality 25 -resize 50% -adjoin -rotate 90 -colorspace Gray output.pdf
sudo apt-get update
sudo apt-get install build-essential libapr1-dev libconfuse-dev libexpat1-dev python-dev libpcre3-dev pkg-config
GANGLIA_VER=ganglia-3.3.7
cd /usr/local/src && \
sudo chown ubuntu . && \
wget --user ahl --password auto4fun http://ganglia.auto.com/$GANGLIA_VER.tar.gz && \
tar zxf $GANGLIA_VER.tar.gz && \
cd $GANGLIA_VER && \
@pdt256
pdt256 / .profile
Last active April 25, 2018 22:48
Git PS1
# brew install bash-git-prompt
# get full path: $(brew --prefix bash-git-prompt)/share/gitprompt.sh
if [ -f /usr/local/opt/bash-git-prompt/share/gitprompt.sh ]; then
GIT_PROMPT_THEME=Default
source /usr/local/opt/bash-git-prompt/share/gitprompt.sh
fi
# brew install bash-completion
# get full path: $(brew --prefix)/etc/bash_completion
if [ -f /usr/local/etc/bash_completion ]; then
@pdt256
pdt256 / smack
Created August 9, 2012 20:35
smack
#!/usr/bin/env php
<?php
/**
* Converts command line output into an html file for any browser
*
* @author Jamie Isaacs
* @package default
**/
/**
@pdt256
pdt256 / mack
Created August 9, 2012 20:34
mack
#!/usr/bin/env php
<?php
/**
* Converts grep and ack output (file:line:matching text) into TextMate links so
* you can click them to open the file.
*
* @author Anthony Bush
* @copyright Anthony Bush (http://anthonybush.com/), 12 February, 2010
* @package default
**/
@pdt256
pdt256 / ackm
Created August 9, 2012 20:34
ackm
#!/bin/bash
tmpAckm="$@";
ack "$@" | mack --cmd="ack $tmpAckm"
@pdt256
pdt256 / gist:2885080
Created June 6, 2012 21:56
PHP go live date
<?php
$now = time();
$live_date = strtotime('2012-03-20 00:00:00');
echo $now . ' - ' . $live_date;
echo "\n";
echo date('c', $now) . ' - ' . date('c', $live_date);
echo "\n";