Usage:
gitmerged.sh
Shows all open feature branches and their respective merge status to common root branches; master, main, staging, acc, develop
gitmerged.sh master staging
#!/usr/bin/env bash | |
[ -z "$1" ] && echo example usage: $0 8.1 >&2 && exit 1 | |
[ ! -f /usr/bin/php${1} ] && echo "No support for this version" >&2 && ls -la /usr/bin/php* >&2 && exit 2 | |
cd ~/.local/bin | |
rm php | |
ln -s /usr/bin/php${1} php | |
hash -r |
<?php | |
/** | |
* Sometimes, shit happens and you end up with duplication of ACF FieldGroups. | |
* This mu-plugin will fix that. | |
* It is also compatible with ACF-to-PHP. | |
*/ | |
add_action( 'admin_init', 'deduplicate_acf_data' ); |
<?php | |
// This will make WordPress ALWAYS use privacy friendly embeds, implemented here are YouTube and Vimeo. | |
// Other services can be implemented by using this code as inspiration. | |
add_filter( 'oembed_dataparse', 'myproject_patch_oembed_urls', 11 ); | |
function myproject_patch_oembed_urls( $html ) { | |
// find vimeo.com urls and add ?dnt=1 to them. | |
$urls = wp_extract_urls( $html ); | |
foreach ( $urls as $old_url ) { | |
if ( false !== strpos( $old_url, 'vimeo.com' ) ) { | |
$new_url = add_query_arg( 'dnt', 1, $old_url ); |
<?php | |
/** | |
* Filters that assist in uploading additional filetypes. | |
* | |
* @package Your_Package | |
* @subpackage Your_Package/Includes | |
*/ | |
namespace Your_Package\Includes; |
<?php | |
/** | |
* Plugin Name: Prevent Redirect Loop | |
* Description: Prevent redirect loops if user adds a redirect to the same page in Yoast SEO Premium or other plugins. | |
* Version: 1.0.0 | |
* Author: Remon Pel | |
*/ | |
// Prevent redirect loops. | |
add_filter( |
#!/usr/bin/env bash | |
# place file one folder above the public_html to prevent access from world. | |
cd "$(dirname "$0")/public_html" | |
for subsite in $(wp site list --format=csv --fields=url 2>/dev/null | tail -n+2); do | |
echo $subsite; | |
wp cron event run --due-now --url=$subsite 2>/dev/null | |
done | |
## IF YOUR SERVER tail DOES NOT SUPPORT OFFSET; |
<?php | |
/** | |
* @file proxy.php Proxy requests to a different server. Very useful for example to set-up Let's Encrypt on a new server without the domain resolving to it. | |
* | |
* Step 1: set-up a domain pointer on the target server that DOES resolve to the same webspace as the original domain. | |
* Step 2: place code in the .htaccess in the source server as well as this php file. | |
* Step 3: configure the $target_domain to point to your newly set-up domain pointer. | |
* | |
* Final note: the 'verbose' function is for debugging this code only. It will probably be of no use to you. | |
*/ |