Skip to content

Instantly share code, notes, and snippets.

In detached head state

Philip Newcomer philipnewcomer

In detached head state
Block or report user

Report or block philipnewcomer

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
philipnewcomer / .maintenance
Created Jun 6, 2018
Enable WordPress maintenance mode (place in root directory)
View .maintenance
$upgrading = time();
philipnewcomer / package.json
Created Nov 13, 2017
Request Test (Node CLI App)
View package.json
"dependencies": {
"sync-request": "^4.1.0"
philipnewcomer / generate-unique-username.php
Last active Jan 9, 2020
Generate a unique username in WordPress
View generate-unique-username.php
* Recursive function to generate a unique username.
* If the username already exists, will add a numerical suffix which will increase until a unique username is found.
* @param string $username
* @return string The unique username.
View remoteip.php
echo 'X-Forwarded-IP: ';
if ( isset( $_SERVER['X-Forwarded-IP'] ) ) {
echo $_SERVER['X-Forwarded-IP'];
echo '<br>REMOTE_ADDR: ';
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
philipnewcomer / wcs-disable-recurring-billing.php
Created Mar 22, 2017
Disable WooCommerce Subscriptions Recurring Billing (on staging or during migration)
View wcs-disable-recurring-billing.php
// Place in the mu-plugins dir.
add_filter( 'woocommerce_subscriptions_is_duplicate_site', '__return_true' );
View gist:c1a43637e5953012ae4e62b4e8f1d85b
tell application "System Events"
set hiddenFilesDisplayStatus to do shell script "defaults read AppleShowAllFiles"
set hiddenFilesNewDisplayStatus to "NO"
if hiddenFilesDisplayStatus is "NO" then
set hiddenFilesNewDisplayStatus to "YES"
end if
do shell script "defaults write AppleShowAllFiles " & hiddenFilesNewDisplayStatus
philipnewcomer / unrestrict-rest-api.php
Created May 8, 2016
Allow WordPress REST API Requests While Restricted Site Access is Active
View unrestrict-rest-api.php
* Plugin Name: Unrestrict REST API
* Plugin URI:
* Description: Allows REST API requests while Restricted Site Access is enabled.
* Version: 0.1.0
* Author: Philip Newcomer
* Author URI:
View gist:c291b4cc570cbf64bd0f
^ install to wp-content/themes/vip/plugins
You can’t perform that action at this time.