Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Graham noginn

View GitHub Profile
View SendFile.php
<?php
/**
* Sends a file for download
*
* @category Noginn
* @copyright Copyright (c) 2009 Tom Graham (http://www.noginn.com)
* @license http://www.opensource.org/licenses/mit-license.php
*/
class Noginn_Controller_Action_Helper_SendFile extends Zend_Controller_Action_Helper_Abstract
View Whitewashing_Controller_Helper_Container.php
<?php
/**
* @package Whitewashing
*
*/
class Whitewashing_Controller_Helper_Container extends Zend_Controller_Action_Helper_Abstract
{
/**
* @var Yadif_Container
*/
@noginn
noginn / gist:170266
Created Aug 19, 2009
ErnestMarples.com API consumer function
View gist:170266
<?php
/**
* This file contains a simple function for consuming the ErnestMarples.com postcode
* geocoding API (http://ernestmarples.com/). The original function was written
* by Stuart Harrison, I just adapted it to not rely on file_get_contents.
*
* @author Tom Graham (adapted from Stuart Harrison's function)
* @link http://www.pezholio.co.uk/2009/07/ernest-marples-php-helper-function/
*/
@noginn
noginn / FormSubmitAnonymous.php
Created Sep 23, 2009
The standard FormSubmit view helper will always output with a name attribute, so I created another helper to output "anonymous" submit buttons. This is also the first #dailygist, where I aim to post a useful gist on Twitter each day for no reason other th
View FormSubmitAnonymous.php
<?php
/**
* Helper to generate a "submit" button without a name attribute
*
* @category Noginn
* @package Noginn_View
* @subpackage Helper
*/
class Noginn_View_Helper_FormSubmitAnonymous extends Zend_View_Helper_FormElement
@noginn
noginn / Capfile
Created Sep 24, 2009
A Capistrano deployment recipe for Zend Framework applications
View Capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'application/configs/deploy'
@noginn
noginn / gist:193881
Created Sep 25, 2009
Some config tweaks for QuakeLive to make enemies more visible. A lazy #dailygist
We couldn’t find that file to show.
@noginn
noginn / array_map.php
Created Dec 28, 2012
Using array_map with array_keys
View array_map.php
<?php
$headers = array(
'X-PAYPAL-APPLICATION-ID' => 'APP-1234567890',
'X-PAYPAL-REQUEST-DATA-FORMAT' => 'NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT' => 'NV'
);
$headerStrings = array_map(function ($key, $value) {
return $key . ': ' . $value;
You can’t perform that action at this time.