Skip to content

Instantly share code, notes, and snippets.

@wylieconlon
wylieconlon / gist:1286265
Created October 14, 2011 04:40
Canvas animation with requestAnimationFrame and mouse tracking for games
var Animator = (function() {
var container,
canvas, ctx,
w, h,
offsetLeft, offsetTop,
lastX, lastY;
var init = function(el, options) {
container = el;
@Fasani
Fasani / Simple-Backbone-WordPress-Example.html
Last active February 4, 2022 04:38
A simple Backbone WordPress Example. Using JSON API plugin. (http://wordpress.org/plugins/json-api/)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simple Backbone WordPress Example</title>
<link rel="stylesheet" href="base.css">
</head>
<body>
<ul id="post-list"></ul>
@lgladdy
lgladdy / grunt-sitemap.php
Created April 13, 2014 14:25
Grunt Sitemap Generator plugin for Wordpress
<?php
/**
* Plugin Name: Grunt Sitemap Generator
* Plugin URI: http://www.github.com/lgladdy
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/
@gmazzap
gmazzap / PointersManager.php
Last active January 13, 2017 19:06
Pointers Tour (WPSE 162794)
<?php namespace GM;
class PointersManager implements PointersManagerInterface {
private $pfile;
private $version;
private $prefix;
private $pointers = array();
public function __construct( $file, $version, $prefix ) {
@zspecza
zspecza / amok_browserify_gulpfile.js
Last active November 23, 2021 07:46
Live inject CSS, Javascript & HTML with BrowserSync, Watchify, Amok & Gulp (excuse the messiness, still a WIP)
/*=====================================*\
build tasks
\*=====================================*/
/**
* This gulpfile is optimised for developing
* React.js apps in ES6 through Babel, and is
* designed to live-inject CSS, HTML and even JavaScript
* changes so maintaining state in an application when
* editing code is super easy.
@filipslavik
filipslavik / gist:6c5330f0083e89897cf3
Created June 5, 2015 19:30
delete un-attached images
<?php
$args = array(
'author' => 3,
'post_status' => 'any',
'post_mime_type'=>'image',
'post_type' => 'attachment',
'nopaging' => true,
'post_parent' => 0,
'date_query' => array('before' => '-10 day'),
var gulp = require('gulp');
var runSequence = require('run-sequence');
var minifyCss = require('gulp-minify-css');
var buildDir = './build/';
var build = new Date().getTime();
var minifyCssSettings = { advanced: true, aggressiveMerging: true };
// Main build
@ericandrewlewis
ericandrewlewis / a.md
Last active October 21, 2025 14:53
The WordPress Customizer

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@patrickodacre
patrickodacre / class-options-metabox.php
Last active December 22, 2015 19:27
Adding metaboxes to an options page using the settings API. Config file is injected to create new fields, choose their metaboxes and sanitization callbacks.
<?php namespace POD_Core\Admin;
/**
* class-options-metabox.php
*
* @package POD Core Functionality
* @author Patrick O'Dacre
* @link http://patrickwho.me
* @copyright 2015 Patrick O'Dacre
* @license GPL-2.0+
*/
<?php
/**
* Plugin Name: NGINX FastCGI cache purge
* Version: 0.1
* Description: Flush NGINX FastCGI cache purge
* Author: The Shipyard Crew
* Author URI: https://theshipyard.se/
* Plugin URI: https://theshipyard.se/
* Text Domain: nginx-fastcgi-cache-purge