This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'pre_post_link', 'make__permalink', 10, 2 ); | |
function make__permalink( $permalink, $post ) { | |
if ( 'page' == $post->post_type && in_array( $post->page_name, array( 'home-page', 'home-page-include' ) ) ) { | |
$permalink = 'http://makezine.com'; | |
} | |
return $permalink; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The days are long, the weather is great, and inspiration is everywhere. I'm taking a summertime hiatus (to work on a majorly cool secret project), but this list of tutorials is sure to keep you busy all season. | |
<strong> | |
Gardening: | |
</strong> | |
<ul> | |
<li> | |
<a href="http://blog.craftzine.com/archive/2010/04/how_to_plant_a_mod_container_g.html"> | |
How-To: Plant a Mod Container Garden @Craftzine.com blog | |
</a> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Removed the bogus stuff in place of strip_tags | |
$att = "value"; | |
foreach ($results as $item) { | |
$image = $item->xpath(".//DataObject[@type='cse_image']/Attribute"); | |
if ( !empty($image)) { | |
echo '<div class="row result"><div class="result">'; | |
echo '<div class="span2">'; | |
echo '<img class="thumbnail" src="'; | |
echo $image[0]->attributes()->$att; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Make: Projects oEmbed | |
Plugin URI: http://makeprojects.com/ | |
Description: Embed a Make Project into your Wordpress blog, just copy and paste the URL of the project (e.g. http://makeprojects.com/Project/Build-a-Makerspace/1390/1 ). This plugin will automatically embed using wp_oembed_add_provider. Enjoy a interactive Make Project's experience right in your blog. | |
Author: whyisjake, tmoskowite | |
Version: 1.0 | |
Author URI: www.makezine.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 60 seconds * 60 minutes * 24 hours = 1 day refresh | |
$refreshInterval = 60*60*24; | |
$input = range(1,30); | |
$arr = array_rand($input, 4); | |
if ( false === ( $featured_products = get_transient( 'featured_products' ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient | |
$request_url = 'http://makershed.com/net/webservice.aspx?api_name=generic\featured_products'; | |
$xml = simplexml_load_file($request_url); |