Skip to content

Instantly share code, notes, and snippets.

<?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 ]" />
@th3d0g
th3d0g / simclick.js
Created April 23, 2014 21:36
Simulate Click in Javascript
// Simulate mouseclick in native JS
function simClick( el ){
var event = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': true
});
var canceled = !el.dispatchEvent(event);
if (canceled) {
@th3d0g
th3d0g / waitFor.js
Created April 23, 2014 22:07
Wait until the test condition is true or a timeout occurs.
/**
* Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @param testFx javascript condition that evaluates to a boolean,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.
* @param onReady what to do when testFx condition is fulfilled,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.
@th3d0g
th3d0g / gist:fe409ee3791493eb581e
Created May 21, 2014 21:07
Canvas fill browser window by setting viewport scale.
var screenScale = 1;
window.devicePixelRatio = window.devicePixelRatio || Math.round(screen.deviceXDPI*10 / screen.logicalXDPI)/10;
// Calc safe zone for pixels.
if( window.devicePixelRatio > 1 ) {
var lScreenWidth = Math.max( screen.width, screen.height ) * window.devicePixelRatio;
var lScreenHeight = Math.min( screen.width, screen.height ) * window.devicePixelRatio;
var SAFE_ZONE_WIDTH = 2048;
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;