Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@whyisjake
whyisjake / ns.php
Created December 13, 2011 20:38
xml_response
<?php
error_reporting('E_All');
$request_url = 'http://news.makerfaire.com/feed/';
$xml = simplexml_load_file($request_url) or die('feed not loading');
print_r($xml);
?>
@whyisjake
whyisjake / .htaccess
Created December 14, 2011 22:08
MAKE .htaccess
php_value max_execution_time 900
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
# BEGIN SJA
RedirectMatch /.svn(/|$) https://encrypted.google.com/search?q=script+kiddie
RedirectMatch /readme.html https://encrypted.google.com/search?q=script+kiddie
@whyisjake
whyisjake / dabblet.css
Created December 16, 2011 04:32
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #fff, yellow);
min-height:100%;
border-radius:5px;
border-bottom:3px solid #0f0;
@whyisjake
whyisjake / tracker.php
Created January 5, 2012 20:45
Tweet, Like, and Plus Tracker
error_reporting(E_ALL);
$url = 'http://makeprojects.com/Project/Kitty-Twitty-Cat-Toy/1439/1';
function get_tweets($url) {
$json_string = file_get_contents('http://urls.api.twitter.com/1/urls/count.json?url=' . $url);
$json = json_decode($json_string, true);
return intval( $json['count'] );
@whyisjake
whyisjake / gist:1567226
Created January 5, 2012 20:52
sample array
(
[serial] => 3373
[name] => Hackett
[company] => Madagascar Institute
[email] => [email protected]
[photo] => http://www.facebook.com/media/set/?set=a.124297057635228.19714.124295664302034#!/photo.php?fbid=1961
[url] =>
[twitter_name] =>
[exhibit] => Array
(
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>MAKE | New Year Card for the Year of the Dragon</title>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
// 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);
@whyisjake
whyisjake / blackout.php
Created January 17, 2012 19:23
blackout
add_action( 'init', 'make_sopa_blackout' );
function make_sopa_blackout() {
if ( ! is_admin() ) {
wp_redirect( 'http://oreilly.com/blackout.html', 302 );
exit;
}
}
@whyisjake
whyisjake / sopa.php
Created January 17, 2012 23:19
SOPA Redirect
add_action( 'init', 'make_sopa_blackout' );
function make_sopa_blackout() {
if ( ! is_admin() ) {
$current_time = current_time( 'timestamp' );
$start_time = strtotime( '01/17/2012 8:00' );
$end_time = strtotime( '01/17/2012 20:00' );
if( $current_time >= $start_time && $current_time <= $end_time ) {
wp_redirect( 'http://oreilly.com/make-blackout.html', 503 );
exit;
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li class="active"><a href="#lA" data-toggle="tab">Section 1</a></li>
<li class=""><a href="#lB" data-toggle="tab">Section 2</a></li>
<li class=""><a href="#lC" data-toggle="tab">Section 3</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="lA">
<p>I'm in Section A.</p>
</div>