Skip to content

Instantly share code, notes, and snippets.

View elcontraption's full-sized avatar
🌈

Darin Reid elcontraption

🌈
View GitHub Profile
@elcontraption
elcontraption / gist:1193509457c215bfce81
Created November 3, 2014 22:30
Patch wp_verify_nonce: fixes Advanced Custom Fields nonce bug.
<?php
/*
Plugin Name: Patch wp_verify_nonce
Description: Fixes Advanced Custom Fields bug: http://support.advancedcustomfields.com/forums/topic/warnings-with-clean-install-of-acf-pro-5-0-9-and-wp-4/
Version: 1.0.0
Author: Darin Reid
Author URI: http://elcontraption.com/
*/
if ( !function_exists('wp_verify_nonce') ) :
@elcontraption
elcontraption / gist:9608222
Last active August 16, 2016 20:18
Gulp connect/watch
/**
* Start up livereload server
*/
gulp.task('connect', $.connect.server({
root: ['dist'],
port: 8080,
livereload: true
}));
/**
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@elcontraption
elcontraption / gist:4028550
Created November 6, 2012 23:58
WordPress change domain query
SET @old_domain = 'http://olddomain.com';
SET @new_domain = 'http://newdomain.com';
UPDATE wp_options SET option_value = replace(option_value, @old_domain, @new_domain) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, @old_domain, @new_domain);
UPDATE wp_posts SET post_content = REPLACE (post_content, @old_domain, @new_domain);
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, @old_domain, @new_domain);
@elcontraption
elcontraption / gist:3788559
Created September 26, 2012 15:02
HTML: Test template
Test Gist
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@elcontraption
elcontraption / Director.lua
Created March 14, 2012 21:37
Director.lua snippet
function DirectorAPI.processExport( functionContext, exportContext )
prefs.useMetaData = exportContext.propertyTable.useMetaData
prefs.openDirector = exportContext.propertyTable.openDirector
local exportSession = exportContext.exportSession
local nPhotos = exportSession:countRenditions()
local album_type = exportContext.propertyTable.album_type
local new_album_name = exportContext.propertyTable.new_album_name
local album_id = exportContext.propertyTable.selected_album_id
local progressScope = exportContext:configureProgress{