Skip to content

Instantly share code, notes, and snippets.

View robinnorth's full-sized avatar
:octocat:

Robin North robinnorth

:octocat:
View GitHub Profile
<?php
/**
* Create ACF setting page under Events CPT menu
*
* @since 1.0.0
*/
if ( function_exists( 'acf_add_options_sub_page' ) ){
acf_add_options_sub_page(array(
'title' => 'Event Settings',
'parent' => 'edit.php?post_type=events',
#!/bin/bash
# Uninstall node.js
#
# Options:
#
# -d Actually delete files, otherwise the script just _prints_ a command to delete.
# -p Installation prefix. Default /usr/local
# -f BOM file. Default /var/db/receipts/org.nodejs.pkg.bom
@robinnorth
robinnorth / reset-ios-simulators.sh
Created December 13, 2016 11:10
Reset iOS Simulators to default
#!/bin/bash
# Kill any running Xcode or CoreSimulator processes
killall Xcode
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
# Remove existing simulators, including any installed apps
rm -rf ~/Library/Developer/CoreSimulator/Devices
# Recreate available devices and simulators to correspond to iOS runtime bundled with installed Xcode version and any additionally-installed runtimes
open /Applications/Xcode.app
# List available devices (in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles
@robinnorth
robinnorth / ip-up
Created December 14, 2016 16:35 — forked from p120ph37/ip-up
PPP VPN split-network/split-DNS script for OSX
#!/bin/sh
####################################################
## ##
## PPP VPN split-network/split-DNS script for OSX ##
## by Aaron Meriwether ##
## ##
## installation: ##
## sudo cp thisfile /etc/ppp/ip-up ##
## sudo chmod 755 /etc/ppp/ip-up ##
## ##
@robinnorth
robinnorth / server-to-server-scp.sh
Last active November 24, 2017 10:43
Server to server SCP files
scp -rv <user>@<remote_host>:<remote_source_path>* <local_target_path>
@robinnorth
robinnorth / Detect.cs
Last active September 11, 2018 16:30
Detect Vive/Oculus usage with SteamVR
// From https://steamcommunity.com/app/358720/discussions/0/343787283754448603/?ctp=2#c1326718197205185044
bool BIsHTCViveController()
{
System.Text.StringBuilder sbType = new System.Text.StringBuilder(1000);
Valve.VR.ETrackedPropertyError err = Valve.VR.ETrackedPropertyError.TrackedProp_Success;
SteamVR.instance.hmd.GetStringTrackedDeviceProperty((uint)trackedObj.index, Valve.VR.ETrackedDeviceProperty.Prop_ManufacturerName_String, sbType, 1000, ref err);
return ( err == Valve.VR.ETrackedPropertyError.TrackedProp_Success && sbType.ToString().StartsWith("HTC") );
}