Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / phpcs.xml
Last active March 18, 2023 19:57
phpcs files for my plugins and core plugins
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="AJF-Coding-Standards">
<description>A custom ruleset to take in account both WordPress and personal standards.</description>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<!-- Exclude these -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
@afragen
afragen / aliases.zsh
Last active March 18, 2023 04:44
My oh-my-zsh aliases
View aliases.zsh
alias wp-git-core="sh -c \"\$(curl -fsSL https://gist.github.com/afragen/e1aa3ffccf1a73618ee6e756bd95d297/raw/core-git-wp.sh)\";cd ."
alias wp-git-develop="sh -c \"\$(curl -fsSL https://gist.github.com/afragen/e1aa3ffccf1a73618ee6e756bd95d297/raw/develop-git-wp.sh)\";cd ."
alias local-socket="SOCKET=\$(mysqld --verbose --help | grep ^socket | awk '{print \$2, \$3, \$4}');ln -sfv \$SOCKET /tmp/mysql.sock"
alias brewup="brew update && brew upgrade && brew cleanup && brew doctor"
#lsof -i | grep LISTEN | grep 'nginx\|httpd'
alias http-listen="lsof -i | grep LISTEN | grep 'nginx\|httpd'"
@afragen
afragen / raspi-setup-gitea.md
Last active February 14, 2023 21:10 — forked from mirhec/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups
View raspi-setup-gitea.md

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

@afragen
afragen / php.ini.hbs
Last active January 11, 2023 22:29
Stuff for xDebug 3.x and Local
View php.ini.hbs
; Add to all lightning services PHP conf files using xDebug 3.x
xdebug.mode=debug
xdebug.client_port=9003
xdebug.start_with_request=trigger
xdebug.discover_client_host=yes
xdebug.idekey=VSCODE
; Add to all lightning services PHP conf files using xDebug 2.x
xdebug.remote_enable=1
xdebug.remote_connect_back=Off
@afragen
afragen / auto-flush-object-cache.php
Last active December 25, 2022 10:25
Catches 'PHP Fatal error Allowed memory size of xxxxxxx bytes exhausted' and 'RedisException' debug.log messages and flushes object cache.
View auto-flush-object-cache.php
<?php
/**
* Auto-flush object cache.
*
* @package Fragen\Auto_Flush_Cache
*
* Plugin Name: Auto-Flush Object Cache
* Plugin URI: https://gist.github.com/afragen/d46d3cc2c7e07d99f921560dfbb70246
* Description: Auto-flush the object cache when error log records PHP Fatal error for allowed memory size.
* Version: 0.7.0
@afragen
afragen / karma.php
Last active December 1, 2022 15:41
Impose karma on specific users
View karma.php
<?php
/**
* Karma.
*
* @package Fragen\Karma
*
* Plugin Name: Karma
* Plugin URI: https://gist.github.com/afragen/b45511007d0a1c07ad285ce6e223a91c
* Description: Impose karma on users.
* Version: 0.5.1
@afragen
afragen / rollback-testing.php
Last active November 7, 2022 13:28
Plugin to simulate plugin/theme update failure for testing Rollback Update Failure feature plugin.
View rollback-testing.php
<?php
/**
* Rollback Update Testing
*
* @package rollback-update-testing
* @author Andy Fragen <andy@thefragens.com>
* @license MIT
*/
/**
@afragen
afragen / git-updater-fastspring-popup.php
Created November 3, 2022 23:34
Add javascript for FastSpring's Git Updater popup store.
View git-updater-fastspring-popup.php
<?php
/**
* Add FastSpring popup store script for Git Updater.
*
* @package FastSpringPopUpStore
*
* Plugin Name: FastSpring Popup Store for Git Updater
* Plugin URI: https://gist.github.com/afragen/e7819dd1e17be5792c299dbef989d446
* Description: Add FastSpring popup store javascript for Git Updater.
* Version: 0.1.0
View stop-plugin-auto-update-success-email.php
<?php
/**
* Stop success email from plugin auto-updates.
*
* @package StopAutoUpdateSuccessEmail
*
* Plugin Name: Stop Plugin Auto-update Success Email
* Plugin URI: https://gist.github.com/afragen/e2f40ed2e71e590a127e8adc1db05948
* Description: Stop success email from plugin auto-updates.
* Version: 0.1.0
@afragen
afragen / add-plugin-dependency-api.php
Last active September 3, 2022 00:15
Add to Dependencies tab via Git Updater PRO REST API
View add-plugin-dependency-api.php
<?php
/**
* Add Plugin Dependency via REST API.
*
* @package Fragen\Plugin_Dependency_API
*
* Plugin Name: Add Plugin Dependency via REST API
* Plugin URI: https://gist.github.com/afragen/ba3fc125fb0ecd242b1b162153d6adf9
* Description: Add plugin dependency data to Dependencies tab via REST API endpoint and allow for Install Now button to function.
* Version: 0.11.3