Mac: Flush DNS cache in Snow Leapord

Run the following command in the terminal
sudo dscacheutil -flushcache

For Windows:
ipconfig /flushdns

HTML: Open link in a new window

The key to use is target="_blank"
Eg:

 <a  target="_blank" href="http://glidingphenomena.blogspot.com/">
My Blog
</a>  

MySQL : Sort by Date and Time together when there are in different columns

Suppose you have date and time in two different columns of your table.
We can sort date and time together by using the ADDTIME function.
 select * from mytable ORDER BY ADDTIME(mydate, mytime);  

You can also use the ADDTIME in the select clause to get data and time together.
 select ADDTIME(mydate, mytime), city from mytable  

jQuery : Scroll to top/bottom of a specific DIV

Scroll to the bottom of the div:
 $jq('#divWithOverflowAuto').animate({   
         scrollTop: $jq('#divWithOverflowAuto')[0].scrollHeight}  
      );  
 }  
Or you can use:
 $jq('#divWithOverflowAuto').animate({   
   scrollTop: $jq('#divWithOverflowAuto').attr('scrollHeight')}  
 );  
}  

Scroll to the top of the div:

 $jq('#divWithOverflowAuto').animate({   
         scrollTop: 0 }  
      );  
 }  

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...