How to show a div for some time and hide it after some time

Lets make an div that stays lit up for 2-3 seconds and take 1 second to blink.
we can use the jQuery’s fadeIn and fadeOut to make the div blink

Create an div

<div class="blow"></div>

Having the style as

.blow
{
background:red;
width:50px;
height:50px; 
float:left
}

The jQuery portion

$(document).ready(function() {
$('.blow').bind('fade-cycle', function() {
    $(this).fadeOut(300, function() {
        $(this).fadeIn(500, function() {
            $(this).trigger('fade-cycle');
        }).delay(3000);
    });
});

$('.blow').each(function(index, elem) {
    setTimeout(function() {
        $(elem).trigger('fade-cycle');
    }, index * 250);
});

});​

In this code the effects apply to all the elements with class blow

How to show custom collections on home page shopify

We can add the custom collection in the admin side and can add many products underneath it
and if we have to show that one in the homepage or in any other page we have to edit the template
Lets create a new collection named Featured and mouse hover on the created collection will indicate the
handle which we can call the custom collection in my case its “featured”

and the code to show the collections is

{% for product in collections.featured.products limit:1 %}
<form action="/cart/add" method="post" class="variants clearfix">   
<a href="{{product.url}}"> 
<div class="img1">
<img src="{{ product.featured_image | product_img_url: 'small' }}">
</div></a>
<div class="side">
<a href="{{product.url}}"> <h1>{{ product.title  | escape }}</h1></a>
<p>{{ product.description | truncatewords:  11 | strip_html }}</p>
{%if product.variants.size > 1 and product.options.size > 1 %}
{% comment %} show drop-down if we've only got 2 or more variants {% endcomment %} 
<select id="product-select" name="id">
{% for variant in product.variants %}
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
{% endfor %}
</select>
{% endif %}

</div>
<button type="submit">+cart</button>
<div class="price"><span>{{ product.price | money }}</span></div>
</form>{% endfor %}

How to get the skin,media url in magento

we can call the images and js files inside the template’s skin folder in an phtml file by the following code snippet

<?php echo $this->getSkinUrl('images/image.jpg') ?>
<?php echo $this->getSkinUrl('js/sample.js') ?>

And in static block we can call it as

{{skin url='images/image.jpg '}}
{{skin url='images/js.jpg '}}

To get the media url in static block use the code

{{media url='/image.jpg'}}

How to find the duplicate values in MySQL

In this post we are discussing about how to find the duplicate values in MySQL. There are a lot of scenarios in which we found this post helpfull.We can find the duplicate values in in MySQL table using the SELECT Query

SELECT column_name, COUNT(*) c FROM table GROUP BY coloumn_name HAVING c &gt; 1;

This will return a result with the column_name value in the first column, and a count of how many times that value appears in the second.

That’s it and hope this post help you to know how to find the duplicate values in MySQL