Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
How to free Symfony2 from the sandbox tutorial (with some help from Git)
http://symfony2tips.blogspot.com/2011/02/how-to-free-symfony2-from-sandbox.html
@wilmoore
wilmoore / application.httpd
Created April 22, 2011 19:41
Bootstrapping a multi-environment ZF 1.x application (please use Composer and Composer's autoloader instead)
<VirtualHost *:80>
ServerName ##APP_DOMAIN##
ServerAlias www.##APP_DOMAIN##
ServerAlias ##APPLICATION_ENV##.www.##APP_DOMAIN##
ServerAlias ##APPLICATION_ENV##.##APP_DOMAIN##
ServerAdmin admin@##APP_DOMAIN##
SetEnv APPLICATION_ENV ##APPLICATION_ENV##
SetEnv SERVER_HOSTNAME ##SERVER_HOSTNAME##
Header append X-Host-List "%{SERVER_HOSTNAME}e"
# The GraphicsMagick action, dependent on the `gm` command, is able to perform
# any number of GraphicsMagick conversions on an image passed in as an input.
# The options hash should specify the +name+ for the particular step (which is
# appended to the resulting image filename) the +command+ (eg. convert, mogrify),
# the +options+ (to the command, eg. -shadow -blur), and the +extension+ which
# will determine the resulting image type. Optionally, you may also specify
# +input+ as the name of a previous step; doing this will use the result of
# that step as the source image, otherwise each step uses the original image
# as its source.
class GraphicsMagick < CloudCrowd::Action
@wilmoore
wilmoore / node-and-npm-in-30-seconds.sh
Created May 18, 2011 20:21 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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 http://npmjs.org/install.sh | sh
@wilmoore
wilmoore / convert.sh
Created June 2, 2011 00:29
convert markdown to reStructured Text (Thanks Doctrine2) - https://github.com/doctrine/dbal-documentation/blob/master/convert.sh
#!/bin/bash
FILES=`find -iname *.txt -print`
for FILE in $FILES
do
# replace the + to # chars
sed -i -r 's/^([+]{4})\s/#### /' $FILE
sed -i -r 's/^([+]{3})\s/### /' $FILE
sed -i -r 's/^([+]{2})\s/## /' $FILE
sed -i -r 's/^([+]{1})\s/# /' $FILE
sed -i -r 's/(\[php\])/<?php/' $FILE
var
PARALLEL_CONNECTS = 10,
http = require('http'),
sys = require('sys'),
connectionCount = 0,
messageCount = 0;
lastMessages = 0;
function addClient() {
@wilmoore
wilmoore / knife.rb
Created June 22, 2011 07:56
Base "knife" configuration for a standard chef-solo setup
# .chef/knife.rb
# SEE: http://wiki.opscode.com/display/chef/Troubleshooting+and+Technical+FAQ
# set some sensible defaults
current_dir = File.dirname(__FILE__)
user = ENV['OPSCODE_USER'] || ENV['USER']
log_level :debug
log_location STDOUT
node_name `hostname`
client_key ''
@wilmoore
wilmoore / Url.php
Created July 21, 2011 15:03
Custom Zend Framework Url Helper (honors existing query string -- works well for pagination links, etc.)
<?php
/**
* @copyright ...
* @author Wil Moore III <[email protected]>
*/
use Zend_View_Helper_Url as Url;
/**
* View Helper to attach a query-string to URL
@wilmoore
wilmoore / SplClassLoader.php
Created September 18, 2011 07:39 — forked from jwage/SplClassLoader.php
PSR-0 SplClassLoader implementation
<?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 / filter-and-sort.coffee
Last active September 27, 2015 11:08
filter-and-sort language comparison
fields = ['firstName', 'middleName', 'lastName', 'suffix']
names = [
{ firstName: 'Diane', middleName: 'Tanya ', lastName: ' Douglas', suffix: '' },
{ firstName: 'Jon ', middleName: '', lastName: ' Watson', suffix: '' },
{ firstName: ' Michelle ', middleName: '', lastName: ' Ajuria', suffix: '' },
{ firstName: 'Elliot ', middleName: '', lastName: 'Gray ', suffix: 'III'},
{ firstName: ' Jason ', middleName: '', lastName: 'Doran', suffix: '' }]
# drop superfluous spaces and empty name parts (i.e. if there is no middle name, get rid of it)
names.every (name) ->