Apr 11, 2014

CSS scrolling at horizontal behavior

Your HTML data.

<div class="wrapper">
  <div class="scrolls">
       <img src="http://placehold.it/50x50" />
       <img src="http://placehold.it/50x50" />
       <img src="http://placehold.it/50x50" />
  </div>
</div>

CSS Data
.wrapper { 
        background:#EE0000; 
        box-shadow: 1px 1px 10px #999; 
        margin: auto; 
        text-align: center; 
        position: relative;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        margin-bottom: 20px !important;
        width: 800px;
        padding-top: 5px;
    }
    .scrolls { 
        overflow-x: scroll;
        overflow-y: hidden;
        height: 80px;
    white-space:nowrap
    } 
    .imageDiv img { 
        box-shadow: 1px 1px 10px #999; 
        margin: 2px;
        max-height: 50px;
        cursor: pointer;
    display:inline-block;
    *display:inline;
    *zoom:1;
    vertical-align:top;
    }

See Reference output here http://jsfiddle.net/YbrX3/

Apr 9, 2014

Simplified version on how to download videos in ustream.tv

Let say this one from Will There Be a Spinoff From The Mentalist?

Here the pattern of the download URL
http://upmv09.gblx.upmv.ustream.tv/0/1/35/{1ST_FIVE_DIG_OF_VID_ID}/{VIDEOID}/1_{CHANNEL_ID}_{VIDEOID}.flv

Given data/URL VIDEOID is 41138669. Now our problem is what is the CHANNELID? To get this one try to press CTRL+U to view the source code.
Here what you see in image below

Now two unknown data already exist. Just to check sure that that you know where the I get the video id. Check below datas.
URL: http://www.ustream.tv/recorded/41138669
VIDEOID: 41138669
CHANNELID: 7262640

And now what is the
1ST_FIVE_DIG_OF_VID_ID
? In our video id(41138669) the First Five(5) digits are 411386

Finally all data need to download the video already define. See summary below.

VIDEOID: 41138669
1ST_FIVE_DIG_OF_VID_ID:411386
CHANNELID: 7262640

See the pattern and the output/outcome url.

http://upmv09.gblx.upmv.ustream.tv/0/1/35/{1ST_FIVE_DIG_OF_VID_ID}/{VIDEOID}/1_{CHANNEL_ID}_{VIDEOID}.flv

URL To Donwload.
http://upmv09.gblx.upmv.ustream.tv/0/1/41/41165/41165663/1_7262640_41165663.flv

Try to download the file here.

Jan 14, 2014

How to override magento model.

Overriding magento model is some tricky base, that's why I want to share how this models Override.


First Mage_Reports_Model_Event_Observer
<models>
    <reports>
        <rewrite>
            <event_observer>Globe_Reports_Model_Event_Observer</event_observer>
        </rewrite>
    </reports>
</models>



Second Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection
<!-- You configs -->
<models>
    <reports_mysql4>
        <rewrite>
            <product_index_viewed_collection>Globe_Reports_Model_Mysql4_Product_Index_Viewed_Collection</product_index_viewed_collection>
        </rewrite>
    </reports_mysql4>
</models>

// Your PHP class
class Globe_Reports_Model_Mysql4_Product_Index_Viewed_Collection extends Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection{

// Put possible override methods or 
//  addition methods you want here
}