Skip to content

Instantly share code, notes, and snippets.

View marchampson's full-sized avatar

Marc Hampson marchampson

View GitHub Profile
@marchampson
marchampson / E3 image utility
Created March 6, 2013 14:46
E3 Image utility example usage
// Upload file
$File = $this->params()->fromFiles('image');
if($File['name'] != '') {
$thumbsDir = array(
array('dir' => 'small',
'resize' => '25'),
array('dir' => 'medium',
'resize' => '50'),
array('dir' => 'large',
@marchampson
marchampson / zf2 tableGateway order
Created March 1, 2013 13:21
tableGateway order
$resultSet = $this->tableGateway->select(function (Select $select) {
$select->order('name ASC');
});
return $resultSet;
@marchampson
marchampson / symlink e3 assets
Created February 27, 2013 16:09
Symlink E3 module assets
@marchampson
marchampson / Sendmail OSX
Created February 27, 2013 12:47
Fix for sendmail on osx after mountain lion
Fix for sendmail on osx after mountain lion
@marchampson
marchampson / install phing osx
Created February 24, 2013 21:05
Install phing with alldeps (i.e. tasks)
$> pear config-set preferred_state alpha
$> pear install --alldeps phing/phing
$> pear config-set preferred_state stable
@marchampson
marchampson / osx Mountain Lion phpunit
Created February 24, 2013 20:57
osx phpunit install
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit
@marchampson
marchampson / homebrew mysql
Last active December 14, 2015 03:59
hombrew mysql
$brew install mysql
$sudo chown -R $(whoami) /usr/local/share
$brew link mysql
@marchampson
marchampson / configure php
Last active December 14, 2015 03:49
php configure
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
@marchampson
marchampson / prettyurl
Created February 21, 2013 10:23
prettyurl creation e3
if($this->title != null) {
$textUtils = new Text();
$this->prettyurl = $textUtils->prettyUrl($this->title);
}
@marchampson
marchampson / zfcuser add fields
Created February 19, 2013 11:56
Add additional fields to zfcuser registation form
public function onBootstrap(MvcEvent $e)
{
$events = $e->getApplication()->getEventManager()->getSharedManager();
$events->attach('ZfcUser\Form\Register', 'init', function($e) {
$form = $e->getTarget();
$form->add(array(
'type' => 'Zend\Form\Element\Select',
'name' => 'role',
'options' => array (
'label' => 'Select Role',