Popular recipes by Jeff Griffiths http://code.activestate.com/recipes/users/835605/2011-05-25T20:52:56-07:00ActiveState Code RecipesPHP 'Struct' port (PHP) 2010-03-28T01:22:31-07:00Jeff Griffithshttp://code.activestate.com/recipes/users/835605/http://code.activestate.com/recipes/577160-php-struct-port/ <p style="color: grey"> PHP recipe 577160 by <a href="/recipes/users/835605/">Jeff Griffiths</a> (<a href="/recipes/tags/iterator/">iterator</a>, <a href="/recipes/tags/iterators/">iterators</a>, <a href="/recipes/tags/oop/">oop</a>). Revision 2. </p> <p>In Ruby, the <a href="http://ruby-doc.org/core/classes/Struct.html">Struct class</a> is a convenient way to create a hash-like object on the fly and use it for your nefarious purposes. PHP 5+ can be convinced to do this type of things as well, it just doesn't have it out of the box. Here is a simple class that implements iterator and allows you to populate the internal data structure similar to how Ruby's Struct works. Syntactic sugar? Probably.</p> <p>Note: I haven't bothered to implement the Ruby Struct API per se, Instead I just got something similar by implementing the Iterator interface and keeping things very PHP-like.</p> Komodo Snippet Wrapper macro (JavaScript) 2011-05-25T20:52:56-07:00Jeff Griffithshttp://code.activestate.com/recipes/users/835605/http://code.activestate.com/recipes/577168-komodo-snippet-wrapper-macro/ <p style="color: grey"> JavaScript recipe 577168 by <a href="/recipes/users/835605/">Jeff Griffiths</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/toolbox/">toolbox</a>). </p> <p>A simple Macro that wraps the current selection in a code block supplied by the requested snippet.</p> Bass class for PDO abstraction (PHP) 2010-03-28T01:16:30-07:00Jeff Griffithshttp://code.activestate.com/recipes/users/835605/http://code.activestate.com/recipes/522993-bass-class-for-pdo-abstraction/ <p style="color: grey"> PHP recipe 522993 by <a href="/recipes/users/835605/">Jeff Griffiths</a> (<a href="/recipes/tags/database/">database</a>). Revision 2. </p> <p>This is a simple base class that extends PDO and provides some useful helper functions such as _getRows and _getAsRow()</p>