Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@codearachnid
codearachnid / customize_event_meta.php
Last active December 19, 2015 20:48
customize your tribe event calendar meta displays with a variety of methods
<?php
/**
* Customize your tribe event calendar meta displays with a variety of methods.
* Place this in your functions.php file within your theme
*/
add_action( 'wp_head', 'custom_event_meta' );
function custom_event_meta(){
// customize just the label
@GaryJones
GaryJones / gist:8430080
Created January 15, 2014 03:08
References for Why Not to Use Singleton Design Pattern
http://www.youtube.com/watch?v=-FRm3VPhseI Google's Clean Code Talks
http://blog.gordon-oheim.biz/2011-01-17-Why-Singletons-have-no-use-in-PHP/
http://sebastian-bergmann.de/archives/882-Testing-Code-That-Uses-Singletons.html
http://eamann.com/tech/making-singletons-safe-in-php/
http://hakre.wordpress.com/2012/06/10/the-missing-patterns-of-the-php-manual/#p2
http://blogs.msdn.com/b/scottdensmore/archive/2004/05/25/140827.aspx
http://www.phptherightway.com/pages/Design-Patterns.html ("You should be wary when using the singleton pattern, as by its very nature it introduces global state into your application, reducing testability.")
http://www.practicaldesignpatternsinphp.com/ ("The Singleton Pattern is perhaps the most well known - and most often misused - pattern in all of PHP design pattern development. Its simplicity, combined with its seeming benefits makes it a widely-used (and overused) pattern. The Singleton is not so much a recommended pattern, as a pattern I recommend you shy away from.")
http://www.sli
@cfoellmann
cfoellmann / tribe-events-activation-connector-oop.php
Last active August 29, 2015 14:00
Auto-(De-)Activate 'The Events Calendar' with 'The Events Calendar Pro' + hide 'The Events Calendar' from plugins.php listing
<?php
class EventsConnector {
var $events_calendar;
public function __construct() {
$this->events_calendar = 'the-events-calendar/the-events-calendar.php';
$events_calendar_pro = WP_PLUGIN_DIR . '/events-calendar-pro/events-calendar-pro.php';
@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@sc0ttkclark
sc0ttkclark / .htaccess
Last active May 3, 2016 17:57
Add these lines to your .htaccess file if you can't get cPanel Let's Encrypt installation or renewal working properly (tested on SiteGround). They MUST go above any WordPress rewrites but below the "RewriteEngine On RewriteBase /" portion.
# Stop processing any rewrites for /.well-known/ files
RewriteCond %{REQUEST_URI} ^/\.well-known/.*$ [NC]
RewriteRule ^ - [L]
@tyrell
tyrell / docker-install-rpi3.md
Last active December 22, 2023 07:36
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@GaryJones
GaryJones / PluginTest.php
Last active August 2, 2016 18:12
Test that plugin called `load_plugin_textdomain()` correctly.
<?php
namespace GAA\CorpManager;
use WP_UnitTestCase;
class PluginTest extends WP_UnitTestCase {
private $domain;
private $mofile;
@schlessera
schlessera / Autoloader.php
Last active August 23, 2020 13:39
Generic Autoloader
<?php namespace Generic;
use RuntimeException;
/**
* Class Autoloader.
*
* This is a custom autoloader to replace the functionality that we would
* normally get through the autoloader generated by Composer.
*
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active December 8, 2023 11:02
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@mirhec
mirhec / raspi-setup-gitea.md
Created September 20, 2017 07:14
Installing Gitea on Raspberry Pi with nginx, SSL and automatic backups

Setup Gitea on Raspberry Pi (3)

These instructions are based on this article: https://www.alexruf.net/2016/05/23/setup-gogs-git-service.html.

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

sudo raspi-config

There you need to enable the SSH server and you should change the hostname.