Insert Content After Some Posts In WordPress

This is a very common usage when you want to add content after some posts in WordPress, like Google Ads, divider or something like that. When reading WPQuestions, I found a good solution for this problem created by Michael Fields.
Add this line to your functions.php file:

Update:scribu has posted another way (maybe better way) to do the same thing. This is the code provided by scribu. Thank you!

function insert_between_posts($post) {
global $wp_query;
// Check if we're in the right template
if (!is_home()) return;
// Check if we're in the main loop
if ($wp_query->post != $post) return;
// Check if we're at the right position
if (1 != $wp_query->current_post) return;
// Display the banner
echo '<div>Some banner</div>';
}
add_action('the_post', 'insert_between_posts');