Skip to content

Instantly share code, notes, and snippets.

View itafroma's full-sized avatar

Mark Trapp itafroma

View GitHub Profile
@itafroma
itafroma / config.yaml
Created October 25, 2015 04:25
Working Symfony2 PuPHPet config using Nginx
vagrantfile:
target: local
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: itafroma.local
memory: '2048'
cpus: '2'
chosen_provider: virtualbox
network:
@itafroma
itafroma / gist:9729592
Created March 23, 2014 20:48
Array keys without quotes
<?php
$foo = [
'bar' => 'value1',
'baz' => 'value2',
];
print $foo[bar] . PHP_EOL;
define('bar', 'baz');
@itafroma
itafroma / gist:5821794
Created June 20, 2013 10:44
PHP 5.3 build error
==> make install
make install
Installing PHP SAPI module: cgi
Installing PHP CGI binary: /usr/local/Cellar/php53/5.3.25/bin/
Installing PHP CLI binary: /usr/local/Cellar/php53/5.3.25/bin/
Installing PHP CLI man page: /usr/local/Cellar/php53/5.3.25/share/man/man1/
Installing build environment: /usr/local/Cellar/php53/5.3.25/lib/php/build/
Installing header files: /usr/local/Cellar/php53/5.3.25/include/php/
Installing helper programs: /usr/local/Cellar/php53/5.3.25/bin/
program: phpize
@itafroma
itafroma / gist:5821674
Created June 20, 2013 10:14
Build errors for brew install php54 (c.f. josegonzalez/homebrew-php#591)
/bin/sh /private/tmp/php54-GFpf/php-5.4.15/libtool --silent --preserve-dup-deps --mode=compile cc -Imain/ -I/private/tmp/php54-GFpf/php-5.4.15/main/ -DPHP_ATOM_INC -I/private/tmp/php54-GFpf/php-5.4.15/include -I/private/tmp/php54-GFpf/php-5.4.15/main -I/private/tmp/php54-GFpf/php-5.4.15 -I/private/tmp/php54-GFpf/php-5.4.15/ext/date/lib -I/private/tmp/php54-GFpf/php-5.4.15/ext/ereg/regex -I/Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 -I/Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/usr/local/opt/zlib/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/gettext/include -I/private/tmp/php54-GFpf/php-5.4.15/ext/mbstring/oniguruma -I/private/tmp/php54-GFpf/php-5.4.15/ext/mbstring/libmbfl -I/private/tmp/php54-GFpf/php-5.4.15/ext/mbstring/libmbfl/mbfl -I/priv
@itafroma
itafroma / gist:3990924
Created November 1, 2012 00:45
Prepared statements
// Don't do this
$name = 'Mark';
$query = "UPDATE users SET name = '" . $name . "' WHERE user_id = 1";
$pdo->query($query);
// Translates to the query UPDATE users SET name = "Mark" WHERE user_id = 1
// so what's the problem?
//
// What if we did this instead:
@itafroma
itafroma / stackexchange-search-tamer.user.js
Created August 11, 2011 05:45
Stack Exchange Search Tamer
// ==UserScript==
// @name Stack Exchange Search Tamer
// @namespace itafroma
// @description Only allow the search box to expand if the user starts typing
// @include http://stackoverflow.com/*
// @include http://*.stackoverflow.com/*
// @include http://*.stackexchange.com/*
// @include http://serverfault.com/*
// @include http://superuser.com/*
// @include http://stackapps.com/*