Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar
🦄
Proverbs 3:21

Wil (₩) Moore III wilmoore

🦄
Proverbs 3:21
View GitHub Profile
@wilmoore
wilmoore / SplClassLoader.php
Created June 5, 2010 04:25 — forked from jwage/SplClassLoader.php
PHP 5.3 Namespace Autoloader
<?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.
@wilmoore
wilmoore / 1-services.yml
Created June 5, 2010 14:40 — forked from loicfrering/1-services.yml
Practical exemple of what can be done with a DI Container in ZF.
parameters:
auth.adapter.entityName: Application_Model_User
auth.adapter.identityField: email
auth.adapter.credentialField: password
services:
auth.adapter:
class: LoSo_Zend_Auth_Adapter_Doctrine2
arguments: [@em, %auth.adapter.entityName%, %auth.adapter.identityField%, %auth.adapter.credentialField%]
auth:
@wilmoore
wilmoore / gist:482700
Created July 20, 2010 08:42 — forked from effkay/gist:203997
UTF-8 Development Notes
Just for everyone's information, if you want to run purely utf8, don't forget the following:
httpd.conf:
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8
php.ini
default_charset = "utf-8"
my.cnf
<?php
error_reporting(E_STRICT | E_ALL);
class ImmutableValueObject extends \ArrayObject
{
public function __construct(array $data = array(), $flags = \ArrayObject::ARRAY_AS_PROPS)
{
parent::__construct($data, $flags);
}
// HOWTO: load LABjs itself dynamically!
// inline this code in your page to load LABjs itself dynamically, if you're so inclined.
(function (global, oDOC, handler) {
var head = oDOC.head || oDOC.getElementsByTagName("head");
function LABjsLoaded() {
// do cool stuff with $LAB here
}
Grab latest ubuntu 10.10 64bit canonical ami from alestic - http://alestic.com/
Create new ec2 instance + add ebs volume (/dev/sdf) + elastic ip
# update hostname + /etc/host
sudo hostname fe1-us.dustinwhittle.net
# add user account + configure keys in sshd_config + add ssh key
require_once 'Zend/Application/Resource/ResourceAbstract.php';
/**
* TODO: short description.
*
* TODO: long description.
*
*/
class My_Resource_Database extends Zend_Application_Resource_ResourceAbstract
{
// Requires node v0.1.100 or a browser with console
function newShape(x, y) {
return {
toString: function () {
return 'Shape at ' + x + ', ' + y;
}
};
}
@wilmoore
wilmoore / symfony-console-program-options-arguments.php
Created January 5, 2011 21:06
Symfony Console -- injecting additional top-level options/arguments at the program level
/**
* php job-queue.php --environment=local [command|namespace:command]
* php job-queue.php --environment=local job:monitor
*
* NOTE:
* looks like you can actually put the option anywhere...the folllowing works just fine
* > php job-queue.php job:monitor --environment=local
*/
// inject custom required argument (execution halts if program is called without this argument)
@wilmoore
wilmoore / example.com.api.vhost
Last active September 19, 2023 08:45
Software Engineering :: Talk :: Tame your build and deploy process - A look at Hudson, PHPUnit, and SSH
<VirtualHost *:80>
SetEnv APPLICATION_ENV local
ServerName api.example.com
DocumentRoot /home/api/apps/api.example.com/current/src/www
<Directory /home/api/apps/api.example.com/current/src/www/>
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from All