This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application; | |
use Locale; | |
use Zend\EventManager\Event; | |
use Zend\ModuleManager\Feature; | |
class Module implements | |
Feature\BootstrapListenerInterface | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Convert "socalnick.dev.phantom.www.ign.com" or "www.ign.com" to "WwwIgnCom" | |
$filter = new Zend\Filter\FilterChain(array( | |
'filters' => array( | |
array( | |
'name' => 'pregReplace', | |
'options' => array( | |
'match' => '/^(.*phantom\.)?([^:]+)(:\d+)?$/i', | |
'replace' => '$2', | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Zend\Validator; | |
class Uri extends AbstractValidator | |
{ | |
const INVALID = 'uriInvalid'; | |
protected $_messageTemplates = array( | |
self::INVALID => "Provided input is not a valid URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The default strategy would add a listener to Application::dispatch() at high | |
// priority. This would inject a ViewModel instance with the layout template set | |
// as the template, no capture_to value, and a false terminal flag. | |
// The default strategy would also listen to Dispatchable::dispatch() at low | |
// priority; a returned ViewModel instance would be injected into the MvcEvent | |
// as the ViewModel. At this time, we'd also check for a template on the | |
// ViewModel, and if none found, auto-determine it and inject it based on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
NewerOlder