Skip to content

Instantly share code, notes, and snippets.

@fergbrain
fergbrain / cron
Created August 16, 2014 20:34
Cleanup Downloads folder once a week
0 0 * * * find ~/Downloads -type f -maxdepth 1 -mtime +7 -exec rm {} \;
0 0 * * * find ~/Downloads -type d -maxdepth 1 -mtime +7 -exec rm -r {} \;
@fergbrain
fergbrain / default.php
Created April 6, 2012 05:47
Display alternate thumbnail
<?php
include(CFCT_PATH.'header/featured/init.php');
if($image === ''){
global $post;
if(get_post_meta($post->ID, 'wp_thumbnail', TRUE)){
$class[] = 'has-featured-img';
$class = implode(' ', $class);
@fergbrain
fergbrain / deploy.sh
Created October 15, 2012 06:13 — forked from BFTrick/deploy.sh
WordPress Plugin Deploy Script
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config
mkdir -p $HOME/src $HOME/tmp
export TMPDIR=$HOME/tmp
export PATH="$HOME/bin:$PATH"
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
###########################################################
# yasm 1.3.0
<?php
/*
Plugin Name: Debug Countdown Timer
Plugin URI: http://www.andrewferguson.net/wordpress-plugins/countdown-timer/
Description: Debug things when they go wrong
Version: 0.1
Author: Andrew Ferguson
Author URI: http://www.andrewferguson.net
Debug Countdown Timer - Debug things when they go wrong
@fergbrain
fergbrain / commonWP.example.com
Created August 19, 2014 20:38
WordPress Multiuser Configuration
#File: /etc/nginx/sites-available/commonWP.example.pw;
index index.php;
#fastcgi_cache start
set $skip_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
<?php
/*
Plugin Name: Subscribe2 HTML License Propagater
Plugin URI: http://semperplugins.com/plugins/subscribe2-html/
Description: Propagates a Subscribe2 HTML License Key over a Multisite Install
Version: 1.0a
Author: Matthew Robinson
Author URI: http://semperplugins.com/plugins/subscribe2-html/
Licence: GPL3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
<?php
/**
* Template Name: Events - Calendar - iCal
*
* Author: Andrew Ferguson, andrew@fergcorp.com / andrew.ferguson@messiahseattle.org
* Copyright (C) 2016 Andrew Ferguson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@fergbrain
fergbrain / content-restriction-meta-box.php
Last active April 1, 2019 12:09
Default restrict data
<?php
//Add to /profile-builder-hobbyist/features/content-restriction/content-restriction-meta-box.php starting after line 62 (" $wppb_selected_roles = get_post_meta( $post->ID, 'wppb-content-restrict-user-role' );" )
//Note that this only applies to posts created directly using the WordPress site, not using the API (e.g. using the WordPress App)
// https://wordpress.stackexchange.com/questions/50043/how-to-determine-whether-we-are-in-add-new-page-post-cpt-or-in-edit-page-post-cp
/**
* is_edit_page
* function to check if the current page is a post edit page
*
* @author Ohad Raz <admin@bainternet.info>
*
chrt 99 ionice -c1 nice -n -20 ~/jamulus/Jamulus --server --nogui --recording /var/www/jamulus/recording/ --log /var/log/jamulus --servername $(uname -n) --centralserver "jamulus.fischvolk.de:22224" --serverinfo "NW WA;Seattle, WA;225" -g --welcomemessage "This is an expermental service and support is not guarenteed. Please contact andrew@fergcorp.com with questions" --licence&