Skip to content

Instantly share code, notes, and snippets.

@BobbyAdamson
BobbyAdamson / randomFlipping.js
Created March 11, 2016 16:09
Flip a random media item that's on the page
randomFlipping = function(){
// So we know what to flip
var mediaItem = $('.xItem.xMedialayer.xContentImage, .xItem.xMedialayer.xContentVideo');
// So we know how many items there are
var totalItemsWithMedia = $(mediaItem).length;
// Want to run the function on a somewhat random interval
setInterval(function(){
function product_price_box_content( $post ) {
wp_nonce_field( plugin_basename( __FILE__ ), 'product_price_box_content_nonce' );
$meta_values = get_post_meta($post->ID, 'product_price', true);
echo '<label for="product_price"></label>';
if($meta_values != '') {
echo '<input type="text" id="product_price" name="product_price" placeholder="enter a price" value="' . $meta_values . '"/>';
} else {
echo '<input type="text" id="product_price" name="product_price" placeholder="enter a price"/>';
}

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

from bs4 import BeautifulSoup
import requests
story_qty = int(raw_input('How many stories do you want to get? '))
page = 1
story_count = 0
stories = []
# Get the data to filter for a given page
def getPageData():