Magento code snippet

# get parameter from Database stored in core_config_data
echo Mage::getStoreConfig('general/imprint/shop_name');
 
# add top category block
edit: /app/design/frontend/default/your-theme/template/page/html/header.phtml
add: <?php echo $this->getChildHtml('topMenu') ?>
link: http://www.learnmagento.org/magento-tips-tricks/category-drop-down-on-main-navigation-menu/
 
test:
<div class="header"><?=$this->getChildHtml('header')?></div>
<div class="col-left"><?=$this->getChildHtml('left')?></div>
<div class="col-main"><?=$this->getChildHtml('content')?></div>
<div class="col-right"><?=$this->getChildHtml('right')?></div>
<div class="footer"><?=$this->getChildHtml('footer')?></div> 
 
 
# add a poll to rigth coloumn?
<block type="core/template" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
 
<reference name="right">
  <block type="newsletter/subscribe" name="right.newsletter" template="newsletter/subscribe.phtml"/>
</reference>
 
<reference name="right">
  <block type="poll/activePoll" name="right.poll">
    <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
    <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
  </block>
</reference> 
 
design config file:
/app/design/frontend/default/default/layout/local.xml
 
# edit top menu block
        <reference name="top.menu">
            <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
        </reference>
 
# inline translate
<?php echo $this->__('Contact Us') ?>
 
# magento display static blocks with custom layout update
<reference name="left">
<block type="cms/block" name="Footer" before="-">
<action method="setBlockId"><block_id>cm_block_name</block_id></action>
</block>
</reference>
 
#
# SQL
#
# list product on top
UPDATE magento.catalog_product_entity
SET updated_at = now( ) + INTERVAL 1 year
WHERE catalog_product_entity.sku in ('YOUR_PRODUCT_SKU');
 
# get item by image name
SELECT catalog_product_entity.sku, catalog_product_entity_media_gallery.value
FROM catalog_product_entity, catalog_product_entity_media_gallery
WHERE catalog_product_entity.entity_id = catalog_product_entity_media_gallery.entity_id
AND value like '%google%'