#Know What You Love Here's everything on the internet I love, prompted by my recent talk at Bitmaker. Enjoy 😘
###Products
<?php | |
/** | |
* DocBlocks for WordPress | |
* | |
* Structural Elements: | |
* -- to be documented with DocBlocks -- | |
* | |
* class | |
* function (including methods) | |
* variable |
<?php | |
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on |
#!/bin/bash | |
# Save the current directory. | |
pushd ./ | |
# Change to the directory that contains the VM. | |
cd ~/Documents/Virtual\ Machines.localized/Debian\ Jessie\ 64\ -\ Base.vmwarevm/ | |
# Defragment and shrink the virtual disk. | |
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d Virtual\ Disk.vmdk |
<?php | |
/* | |
Plugin Name: ACF Customizer Patch | |
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73 | |
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer. | |
Author: Mark Fabrizio | |
Version: 1.0 | |
Author URI: http://owlwatch.com/ | |
*/ | |
class acf_customizer_patch |
function load_ga_error_script() { | |
// Load the JS file (jquery is a dependency) | |
wp_enqueue_script( 'ga-send-error-event', get_stylesheet_directory_uri() . '/js/ga-send-error-event.js', array('jquery' ) ); | |
} | |
add_action( 'wp_enqueue_scripts', 'load_ga_error_script' ); |
<?php | |
/** | |
* Require basic authentication for all pages except home page | |
* | |
* @return void | |
*/ | |
function motivast_require_auth() { | |
define('AUTH_USER', 'admin'); |
// underscore's throttle-metod | |
var throttle = function(func, wait) { | |
var context, args, timeout, throttling, more, result; | |
var whenDone = _.debounce(function(){ more = throttling = false; }, wait); | |
return function() { | |
context = this; args = arguments; | |
var later = function() { | |
timeout = null; | |
if (more) func.apply(context, args); |
<?php // Don't copy this line... | |
/** | |
* This function will Kill 'blogs/editor' rewrite rules | |
* to fix the broken pagination issue on this page: | |
* '/blogs/editor/' | |
* | |
* This fix was needed because we add rewrite rules for CPT: editor | |
* And because '/blogs/editor/' is also a static page, the pagination | |
* on that page e.g., '/blogs/editor/page/4/' was broken. |
/* | |
* Sanitize Checkbox | |
*/ | |
// Source: https://github.com/FlagshipWP/flagship-library/blob/develop/customizer/classes/customizer-base.php | |
/** | |
* Sanitize a checkbox to only allow 0 or 1 | |
* | |
* @since 1.2.0 | |
* @access public |