Snippet: Magento - Using OR and LEFT JOIN in addAttributeToFilter

I'm still pretty new to Magento, and am learning more about it every day. I've been trying to learn all I can about internals such as managing collections & recently stumbled on trying to filter a collection by two attributes. I wanted to build a list of all products that had one OR another attribute set to certain values.

I found lots of documentation on addAttributeToFilter that showed how to add several filters creating an "AND" relationship and also examples how to test if a single attribute had one value or another. Perhaps it's just me, but I always find it hard to find documentation on how to do anything more complex than the basics in Magento!

protected function _prepareCollection() 
{
  $collection = Mage::getModel('catalog/product')->getCollection();
  $collection->addAttributeToFilter(
    array(
      array('attribute'=>'my_attribute', 'eq'=>'0'),
      array('attribute'=>'my_other_attribute', 'neq'=>'0')
    ),
    '',
    'left'
  );
}

After a bit of playing I found you can pass nested arrays with different attribute values to create the "OR" relationship in the generated SQL. To get this working correctly I also had to pass "left" as the final parameter to make Magento use left joins rather than cross joins. It's neat and tidy once you know it, but a bit awkward to figure out if you don't!

A Note on Snippets: To me Magento is a mind boggling world of abstraction, configuration and depths of potential knowledge. I find the documentation less than helpful and it is often the simplest pieces of code which are the hardest to either find or remember. These snippets are placed here for my own reference and will hopefully be useful to others. If you find them useful or have any suggestions, please let me know.