Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@whyisjake
whyisjake / entity.json
Last active December 14, 2015 23:39
First go at the new API.
{
"header": {
"version": "0.5",
"generation_date": "2013-03-15 04:23:04"
},
"entities": {
"0": {
"id": 2115,
"original_id": 2115,
"thumb_img_url": "http://newnewmf.insourcecode.com/wp-content/uploads/2013/02/cyclonecloseup2-500x283.jpg?w=80&h=80&crop=1",
@whyisjake
whyisjake / parts-grabber.php
Created March 6, 2013 01:22
Having issues getting all of the parts data from the Make: Projects API. Should be getting the type, and quantity from the response. Not seeing it here.
<?php
/**
* Trying to grab the parts quantity and the type, but they are missing.
* Check this page: http://makeprojects.com/api/0.1/guide/56 and note the parts array.
*/
header('Content-Type: text/html; charset=utf-8');
$url = 'http://makeprojects.com/api/0.1/guide/56';
$contents = file_get_contents( $url );
//echo $contents;
@whyisjake
whyisjake / browser.json
Created March 5, 2013 23:36
Getting different results from wpcom_vip_file_get_contents, file_get_contents, browser, curl... Trying to pull down this URL: http://makeprojects.com/api/1.0/guide/4
{
"topic": "Cheesemaking",
"url": "http://makeprojects.com/Project/Goat+Cheese/4/1",
"guide": {
"author": {
"text": "Dale Dougherty",
"userid": 2
},
"categories": [
"Cheesemaking",
@whyisjake
whyisjake / hexbright.md
Created February 26, 2013 18:59
Hexbright Review

= HexBright

Started as a Kickstrater project, the Hexbright is not just a bright flashlight, it's also programmable. The Hexbright packs a USB rechargeable Lithium-Ion battery that in the low mode is good for over 30 hours of run time. Out of the box, there are three brightness settings: 50, 150, or 500 lumens. There is also a strobe mode that blinks that flashlight at the 150 lumens setting. Beside the brightness, and the rugged aluminum construction is the onboard, Arduino compatible board that allows the flashlight to be programmed. Community sourced programs feature different brightness settings, morse code, and my favorite, a program that allows you to use the built in accelerometer to vary the brightness of the flashlight by the angle that the flashlight is being held. While not cheap, they start at $99, it's functional tool that offers plenty of features, is compact in size and built to last. It's the perfect addition to any makers toolbox.

@whyisjake
whyisjake / gist:5040906
Created February 26, 2013 18:37
Testing.
Here is my new gist.
<?php
$arr = array('http://placekitten.com/300/250', 'http://placekitten.com/400/150');
$shuffle = array_rand($arr, 1);
// print_r($shuffle);
echo '<img src="' . esc_url( $arr[$shuffle] ) . '" />';
@whyisjake
whyisjake / gist:5032414
Created February 25, 2013 19:19
Simple image swapper
<?php
$arr = array('http://placekitten.com/300/250', 'http://placekitten.com/400/150');
$shuffle = array_rand($arr, 1);
// print_r($shuffle);
echo '<img src="' . esc_url( $arr[$shuffle] ) . '" />';
@whyisjake
whyisjake / gist:5032413
Created February 25, 2013 19:19
Simple image swapper
<?php
$arr = array('http://placekitten.com/300/250', 'http://placekitten.com/400/150');
$shuffle = array_rand($arr, 1);
// print_r($shuffle);
echo '<img src="' . esc_url( $arr[$shuffle] ) . '" />';
@whyisjake
whyisjake / gist:4990287
Created February 19, 2013 21:40
Sponsor Slider
<div id="sponsor-area" class="featured">
<h3>Maker Faire Sponsors</h3>
<div id="sponsorCarousel" style="height:240px;margin-top:10px;margin-bottom:10px;" class="carousel slide sponsorCarousel">
<div class="carousel-inner" style="background-color:#fff;">
<div class="item active">
<div class="table-cell">
<a href="http://www.radioshack.com/home/index.jsp"><img style="margin-left:10px;width:280px !important;" src="http://makezineblog.files.wordpress.com/2012/08/radioshack.gif?w=280" alt="RadioShack" valign="center" title="RadioShack" /></a>
</div>
</div>
<div class="item">
@whyisjake
whyisjake / index.php
Created February 19, 2013 04:01
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}