Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / local-symlink.sh
Last active February 10, 2020 08:42
For use with Local by Flywheel (Pressmatic) Volumes Addon to create symlinks for better IDE integration

Keybase proof

I hereby claim:

  • I am afragen on github.
  • I am afragen (https://keybase.io/afragen) on keybase.
  • I have a public key ASC9c_nvGTdGKRUkvpcv5fUMo-02_TE4nhcoRSxcliEqVQo

To claim this, I am signing this object:

@afragen
afragen / Customfile.rb
Last active May 26, 2017 22:04
A Customfile for VVV to auto-create synced folders for specific VVV site and bash file to convert shared folder to symlinks.
# -*- mode: ruby -*-
# vi: set ft=ruby :
config.vm.provider :virtualbox do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
#v.memory = 2048
end
# config.vm.synced_folder "/Users/afragen/Documents/github/github-updater", "/srv/www/test3/htdocs/wp-content/plugins/github-updater", :owner => "www-data", :mount_options => [ "dmode=775", "fmode=774" ]
@afragen
afragen / remove-update-nag.php
Last active December 28, 2015 18:39
Remove plugin update nags
<?php
//https://dd32.id.au/2011/03/01/disable-plugin-update-notification-for-a-specific-plugin-in-wordpress-3-1/
add_filter( 'site_transient_update_plugins', 'dd_remove_update_nag' );
function dd_remove_update_nag( $value ) {
$hide_update_nags = array(
'akismet/akismet.php',
);
foreach ( $hide_update_nags as $plugin ) {
if ( isset( $value->response[ $plugin ] ) ) {
unset( $value->response[ $plugin ] );
@afragen
afragen / tooltip.php
Created December 10, 2015 00:06
An override template for ECP 4.0 week view tooltip display. It will strip HTML from the tooltip.
<?php
// Place in {your-theme}/tribe-events/pro/week/tooltip.php
/**
*
* Please see single-event.php in this directory for detailed instructions on how to use and modify these templates.
*
*/
@afragen
afragen / http-api-debug.php
Created November 21, 2015 01:06
Debug HTTP API calls in WordPress
<?php
add_action( 'http_api_debug', 'viper_http_api_debug', 15, 5 );
function viper_http_api_debug( $response, $type, $class, $args, $url ) {
// You can change this from error_log() to var_dump() but it can break AJAX requests
var_dump( "\n<br />" . 'Request URL: ' . var_export( $url, true ) );
var_dump( "\n<br />" . 'Request Args: ' . var_export( $args, true ) );
var_dump( "\n<br />" . 'Request Response : ' . var_export( $response, true ) );
}
@afragen
afragen / dmd-legend-fix.php
Last active August 29, 2015 14:18
Fix for danishmaritimedays.com
<?php
use Fragen\Category_Colors;
add_action( 'plugins_loaded', 'teccc_load_options_class', 20 );
function teccc_load_options_class() {
if ( class_exists( '\\Fragen\\Category_Colors\\Main' ) ) {
new Category_Colors_Options();
}
}
@afragen
afragen / admin-user-can.php
Created September 3, 2014 23:41
A plugin to show that an admin user really can do anything.
<?php
/*
Plugin Name: Admin User Can
Plugin URI: https://gist.github.com/afragen/97ac1e349316f51fd40c
Author: Andy Fragen
Author URI: http://thefragens.com/
Description: A plugin to show that an admin user really can do anything.
Version: 0.0.1
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@afragen
afragen / gist:9865801
Created March 30, 2014 01:24
Display EDD Ticket downloads only on specific page(s). Modified from @sumobi
<?php
function sumobi_edd_downloads_query( $query, $atts ) {
global $wp_query;
if ( 'insert_page_slug_here' === $wp_query->query_vars['pagename'] ) {
$query['meta_key'] = '_tribe_eddticket_for_event';
}
return $query;
}
@afragen
afragen / x-chars-extra.php
Created October 9, 2013 01:29
"The plugin generated x characters of unexpected output during activation" error during WP plugin activation. Add the code to your plugin to see where the error is.
<?php
add_action('activated_plugin','save_error');
function save_error(){
update_option('plugin_error', ob_get_contents());
}
echo get_option('plugin_error');