This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Allow a whitelisted set of inline SVGs via a shortcode. | |
* | |
* SVGs ARE NOT IMAGES, they're mini XML applications which can run JavaScript and embed arbitrary | |
* resources across domain boundaries. There are a lot of attack vectors, and they're not well | |
* understood yet. A lot of caution needs to be taken when allowing SVGs, so for now we're only | |
* whitelisting a handful of them when needed. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Treat up/down as page-up, page-down, so that clicker will step through each slide instead of only up/down slides | |
*/ | |
document.addEventListener( 'keydown', function( event ) { | |
switch ( event.keyCode ) { | |
// k, up | |
case 75: | |
case 38: | |
Reveal.navigatePrev(); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Log REST API errors | |
* | |
* @param WP_REST_Response $result Result that will be sent to the client. | |
* @param WP_REST_Server $server The API server instance. | |
* @param WP_REST_Request $request The request used to generate the response. | |
*/ | |
function log_rest_api_errors( $result, $server, $request ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create symlinks for shared directories and files. | |
* | |
* This is a copy of the default `deploy:shared` task, but modified to create relative symlinks. See | |
* `deploy:symlink` for details. | |
*/ | |
task( 'deploy:shared', function() { | |
$sharedPath = "{{deploy_path}}/shared"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This is now available as a WP-CLI package: | |
* | |
* wp package install iandunn/wp-cli-plugin-active-on-sites | |
* wp plugin active-on-sites <plugin_slug> | |
* | |
* See https://github.com/iandunn/wp-cli-plugin-active-on-sites | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Avoid having to enter a password when you just want to `svn up` | |
function svn() { | |
local args=($@) | |
local rest=(${args[@]:1:${#args[@]}}) | |
local SVN="/usr/bin/svn" | |
case $1 in | |
up) | |
source /root/config/environment-variables | |
/bin/bash -c "$SVN --no-auth-cache --username $SVNUSER --password $SVNPASS up $rest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant @ vvv in /srv/www/wordpress-meta-environment/wordpressorg.dev/public_html/wp-content/plugins | |
> git clone git@github.com:WordPress/phpdoc-parser.git | |
Cloning into 'phpdoc-parser'... | |
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts. | |
remote: Counting objects: 1860, done. | |
remote: Total 1860 (delta 0), reused 0 (delta 0), pack-reused 1860 | |
Receiving objects: 100% (1860/1860), 1.00 MiB | 169.00 KiB/s, done. | |
Resolving deltas: 100% (994/994), done. | |
Checking connectivity... done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Configure PHPMailer to send via PHP's mail() | |
* | |
* @param PHPMailer $phpmailer | |
*/ | |
function phpmailer_send_via_mail( $phpmailer ) { | |
$phpmailer->IsMail(); | |
} | |
add_action( 'phpmailer_init', 'phpmailer_send_via_mail', 999 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Red Notification Dot From Trello Favicon | |
// @namespace https://iandunn.name | |
// @version 0.1 | |
// @description Trello adds a red dot to their favicon when new notifications are available, which I find useless and distracting. This restores the original icon after a few seconds, so that you normally see the favicon without the dot. | |
// @author Ian Dunn | |
// @match https://trello.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moved to https://core.trac.wordpress.org/ticket/40702 |