Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@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 / 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 / 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 / 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 / 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" ]

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 / 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
@afragen
afragen / .htaccess extras
Created March 26, 2017 03:46
Improve server scores
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
@afragen
afragen / improved-singleton.php
Created April 26, 2017 18:43
A Better WordPress Singleton
<?php
//http://jamesdigioia.com/a-better-wordpress-singleton/
class PluginClass
{
protected static $instance = null;
public function __construct($file)
{
@afragen
afragen / raspi-setup-gitea.md
Last active December 20, 2023 16:47 — forked from mirhec/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups

Setup Gitea on Raspberry Pi (3b+)

These instructions are based on this article: https://docs.gitea.io/en-us/install-from-source/.

Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:

Use Noobs to install Raspian.

Open menu Preferences > Raspberry Pi Settings