Skip to content

Instantly share code, notes, and snippets.

View StephenHodgson's full-sized avatar
👾
Raging against pixels

Stephen Hodgson StephenHodgson

👾
Raging against pixels
View GitHub Profile
@StephenHodgson
StephenHodgson / OpenUnity.sh
Created January 5, 2023 23:26
Opens project from command line so long as Unity Hub and editor is installed
#!/bin/bash
# Set the directory
directory=$1
# If no directory was specified, use the current working directory
if [ -z "$directory" ]
then
directory=$(pwd)
fi
@StephenHodgson
StephenHodgson / recursively-checkout-submodule-branches.sh
Created June 4, 2021 08:28
Recursively checks out all submodule branches instead of being in a detached head
#!/bin/bash
git submodule foreach -q --recursive 'echo $name && git switch -C $(git name-rev --exclude=refs/tags/\* --name-only $(git rev-parse @{-1}))'
@StephenHodgson
StephenHodgson / set-default-program.txt
Last active January 5, 2023 23:45
Set Visual Studio Code as the default program for opening files without an extension in Windows
// https://superuser.com/questions/13653/how-to-set-the-default-program-for-opening-files-without-an-extension-in-windows
assoc .="No Extension"
ftype "No Extension"="C:\Program Files\Microsoft VS Code\Code.exe" "%1"
@StephenHodgson
StephenHodgson / Program.cs
Last active May 27, 2021 21:33
Test recording microphone data using LibVLCSharp
using System;
using System.IO;
using LibVLCSharp.Shared;
namespace test_microphone_recording
{
internal class Program
{
private static MemoryStream stream;
private static LibVLC vlc;
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEditor;
using XRTK.Editor.Profiles;
using XRTK.Examples.Demos.CustomExtensionServices;
namespace XRTK
{
/// <summary>
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using XRTK.Definitions;
using UnityEngine;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
/// <summary>
/// This is the custom configuration profile for your custom extension service.
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using UnityEngine;
using XRTK.Extensions;
using XRTK.Services;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using XRTK.Interfaces;
namespace XRTK.Examples.Demos.CustomExtensionServices
{
/// <summary>
/// The custom interface for your extension service.
@StephenHodgson
StephenHodgson / InputDemo.cs
Last active March 11, 2019 19:05
Example script for Getting to know the new XRTK
public class InputTest : BaseInputHandler, IMixedRealitySpatialInputHandler
{
[SerializeField]
private MixedRealityInputAction myAction = MixedRealityInputAction.None; // <-- Set in the inspector.
public void OnInputUp(InputEventData eventData)
{
if (eventData.MixedRealityInputAction == myAction)
{
Debug.Log($"OnInputUp {eventData.InputSource.SourceName} | {eventData.MixedRealityInputAction.Description}");