Skip to content

Instantly share code, notes, and snippets.

View dwenaus's full-sized avatar

Deryk Wenaus dwenaus

View GitHub Profile
@dwenaus
dwenaus / git-cleanup
Last active December 1, 2017 19:39
a quick way to clean-up local branches which no longer exist remotely
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -n 1 git branch -d
the above command will show which will be deleted. use -D instead of -d to delete them all
tested and works
does not delete local branches which only exist locally and have never existed remotely.
a better version would test whether the branch creates a diff or pr. ie. it's been merged.
@dwenaus
dwenaus / apache-conf
Created April 2, 2015 12:05
apache conf
Listen 8000
<VirtualHost *:8000>
LoadModule php5_module /home/ubuntu/.phpenv/versions/5.6.2/libexec/apache2/libphp5.so
DocumentRoot /home/ubuntu/programs
DirectoryIndex index.php
ServerName localhost
<FilesMatch \.php$>
SetHandler application/x-httpd-php
@dwenaus
dwenaus / gist:8762785
Created February 2, 2014 03:47
code to add to functions.php so that BuddyPress Group Email Subscription plugin plays nicely with WP Better Emails plugin
// if the WP_Better_Emails plugin is installed, stop BuddyPress Group Email Subscription plugin from wrapping digests with <html><body>$message</body></html>
function my_dont_wrap_digests_with_html_twice( $message, $message_pre_html_wrap ) {
if ( class_exists( 'WP_Better_Emails' ) ) {
$message = $message_pre_html_wrap;
}
return $message;
}
add_filter( 'ass_digest_message_html', 'my_dont_wrap_digests_with_html_twice', 10, 2 );