Skip to content

Instantly share code, notes, and snippets.

View SeanTOSCD's full-sized avatar
👋
Reach out.

Sean Davis SeanTOSCD

👋
Reach out.
View GitHub Profile
@mattonomics
mattonomics / prying-eyes.php
Last active December 12, 2015 12:39
This will make sure that only logged in users can view ANY content on the site. Drop it at the tip top of your functions.php file.
<?php
// fancy PHP 5.3+ style
add_action( 'template_redirect', function() {
if ( ! is_user_logged_in() ) {
wp_redirect( wp_login_url() );
exit;
}
} );
@DrewAPicture
DrewAPicture / gistmerge.sh
Last active August 15, 2016 18:12
Script to merge a Gist fork into your original. You'll need the id of your Gist and the id of the fork.
#!/bin/bash
# usage: ORIG=###### NEW=###### ./gistmerge.sh
# $ORIG = The Gist ID of your Gist
# $NEW = The Gist ID of the fork
# Note: chmod u+x gistmerge.sh may be necessary
# if you're getting permissions errors
printf "\n\n... Cloning original Gist.\n\n"