Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / core-git-wp.sh
Last active June 10, 2023 22:19
Create WP Core development environments in Local Lightning
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 --wp-version=trunk --wp-ts-version=trunk
cd public/
@afragen
afragen / setup-phpunit.sh
Created July 27, 2019 21:39 — forked from keesiemeijer/setup-phpunit.sh
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.
<?php
$config = [
//'token' => '012345',
'repo' => 'satispress',
'username' => 'cedaro',
];
$file_location = 'releases/';
$file_name = 'test.zip';
@afragen
afragen / .gitignore
Last active February 6, 2021 17:06
A default .gitignore for use with WP Core development workflow https://localbyflywheel.com/community/t/workflow-for-development-using-wp-core/13011
.gitignore
.vscode
wp-config\.php
wp-tests-config\.php
debug\.log
local-phpinfo\.php
/wp-content
@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

@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 / .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 / 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

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 / 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" ]