Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
// 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);
<?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
*/
//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;
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>
@whyisjake
whyisjake / perm.php
Created August 20, 2012 18:44 — forked from mjangda/perm.php
New Permalink
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;
}
@whyisjake
whyisjake / Post Edit Screen Mockup.png
Created December 12, 2012 19:41 — forked from anonymous/how I am getting to the step data.
What we are trying to accomplis here is an easy way to manage all of the step data from Make: Projects.
Post Edit Screen Mockup.png
@whyisjake
whyisjake / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console