Skip to content

Instantly share code, notes, and snippets.

View celmaun's full-sized avatar
🏠
Working from home

Celmaun celmaun

🏠
Working from home
View GitHub Profile
@celmaun
celmaun / code.php
Created November 25, 2011 15:03
Get youtube video download URLs
preg_match("/yt\.setConfig\(\{\s+\'PLAYER_CONFIG\'\:\s(?<config>.*?)\s+\}\)/s", $page, $matches);
$config = json_decode($matches['config']);
$fmts = explode(',', $config->args->url_encoded_fmt_stream_map);
foreach( $fmts as $k => $v ) { parse_str($v, $fmts[$k]); }
<?php
// Quick bug fix for Issue #24837 (http://www.magentocommerce.com/bug-tracking/issue/?issue=10453)
$rootBlock = Mage::app()->getLayout()->getBlock('root');
if ( false !== $rootBlock ) {
foreach ( Mage::getModel('page/config')->getPageLayouts() as $pageLayout ) {