Skip to content

Instantly share code, notes, and snippets.

View marchampson's full-sized avatar

Marc Hampson marchampson

View GitHub Profile
@marchampson
marchampson / collaborator api
Created January 28, 2013 14:11
Add collaborator from command line
curl -i -u "my_user_name:my_password" -X PUT -d '' 'https://api.github.com/repos/my_gh_userid/my_repo/collaborators/my_collaborator_id'
@marchampson
marchampson / useful mysql
Created February 8, 2013 12:31
Useful mysql
Character encoding of tbl (where tbl = tablname):
show create table tbl\G
Update character set:
alter table <tablename> modify <columname> <type> character set utf8
@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',
@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 / 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 / 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 / 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 / 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 / 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 / symlink e3 assets
Created February 27, 2013 16:09
Symlink E3 module assets