Skip to content

Instantly share code, notes, and snippets.

View th3d0g's full-sized avatar

Nathan Broadbent th3d0g

View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
<meta itemprop="name" content="[ TITLE ]" />
<meta itemprop="image" content="[ LISTING IMAGE ]" />
<meta itemprop="description" content="[ ARTICLE DESCRIPTION ]" />
<meta name="description" content="[ ARTICLE DESCRIPTION ]" />
<meta name="author" content="[ AUTHOR FULL NAME ]" />
<meta property="article:author" content="[ GOOGLE+ AUTHOR URL ]" />
<meta property="article:published_time" content="[ PUBLISHED TIMESTAMP ]" />
<meta property="article:section" content="[ CATEGORY ]" />
package nl.stroep.games.components;
import flambe.Component;
import nape.space.Space;
/**
* @author Mark Knol [blog.stroep.nl]
*/
class NapeDebugView extends Component
{
private var _space:Space;
@th3d0g
th3d0g / gist:6cd57c6d0badc5772480
Last active October 19, 2015 21:30 — forked from anonymous/gist:5f401192b236f8daaf1c
Sensei - Tag Courses
// Sensei - Add tags to Courses
// Run this after "register_post_type( 'course'..." in "class-woothemes-sensei-posttypes.php"
register_taxonomy(
'course_tag',
'course',
array(
'hierarchical' => false,
'label' => __( 'Tags', CURRENT_THEME ),
'singular_name' => __( 'Tag', CURRENT_THEME ),
@th3d0g
th3d0g / functions.php
Created November 6, 2015 00:15 — forked from jameskoster/functions.php
WooCommerce - Exclude products from a particular category on the shop page
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() && is_shop() ) {
$q->set( 'tax_query', array(array(
@th3d0g
th3d0g / mailchimp_listsubscribe.php
Created July 17, 2016 20:08 — forked from anonymous/mailchimp_listsubscribe.php
Mailchimp Subcribe to List PHP
<?php
// Populate using POST vars
$data = [
'email' => '[email protected]',
'status' => 'subscribed'
];
var_dump( syncMailchimp($data) );