Skip to content

Instantly share code, notes, and snippets.

Andy Fragen afragen

Block or report user

Report or block afragen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@afragen
afragen / set-category-colors-hash.php
Created Oct 30, 2019
Set the Category Colors options hash to pre-defined hash
View set-category-colors-hash.php
<?php
/**
* Plugin Name: Set Category Colors Options Hash
* Author: Andy Fragen
* Author URI: https://github.com/afragen
* Version: 0.1
* Requires PHP: 5.3
*/
add_filter( 'teccc_set_options_hash', function(){
@afragen
afragen / aliases.zsh
Last active Aug 18, 2019
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 ."
@afragen
afragen / apply-trac-patch.sh
Last active Sep 20, 2019
Apply patches or change sets from core.trac.wordpress.org tickets.
View apply-trac-patch.sh
#!/usr/bin/env bash
# ====================================================================================
# Script to install patches or changesets from https://core.trac.wordpress.org
# I use with Local Lightning by Flywheel by installing in `/app` directory.
#
# Patches and changesets are saved in `/tmp/` as a default.
# You will use the patch URL in the script.
# ====================================================================================
@afragen
afragen / afragen.zsh-theme
Last active Sep 5, 2019
Modification of PROMPT in robbyrussell.zsh-theme
View afragen.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} $fg[grey]%m: %{$fg[cyan]%}${PWD/#$HOME/~}%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@afragen
afragen / core-git-wp.sh
Last active Nov 2, 2019
Create WP Core development environments in Local Lightning
View core-git-wp.sh
cd ..
mv ./public/wp-config.php .
rm -rf ./public
git clone git://core.git.wordpress.org/ public
ln -sv $PWD/wp-config.php $PWD/public/wp-config.php
curl -o ./public/.gitignore https://gist.githubusercontent.com/afragen/43dfff563e942353d866c81904498cb2/raw/.gitignore
curl -o setup-phpunit.sh https://raw.githubusercontent.com/afragen/setup-phpunit/master/setup-phpunit.sh
curl -o apply-trac-patch.sh https://gist.githubusercontent.com/afragen/977d765414189d5f5fae42215fe92a27/raw/apply-trac-patch.sh
bash setup-phpunit.sh
cd public/
@afragen
afragen / setup-phpunit.sh
Created Jul 27, 2019 — forked from keesiemeijer/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
View setup-phpunit.sh
#!/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.
View get_array_of_release_assets.php
<?php
$config = [
//'token' => '012345',
'repo' => 'satispress',
'username' => 'cedaro',
];
$file_location = 'releases/';
$file_name = 'test.zip';
View .gitignore
.gitignore
wp-config\.php
wp-tests-config\.php
debug\.log
local-phpinfo\.php
/wp-content/plugins/*
/wp-content/upgrade/*
/wp-content/db\.php
@afragen
afragen / raspi-setup-gitea.md
Last active Nov 7, 2019 — forked from mirhec/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups
View raspi-setup-gitea.md
@afragen
afragen / improved-singleton.php
Created Apr 26, 2017
A Better WordPress Singleton
View improved-singleton.php
<?php
//http://jamesdigioia.com/a-better-wordpress-singleton/
class PluginClass
{
protected static $instance = null;
public function __construct($file)
{
You can’t perform that action at this time.