Skip to content

Instantly share code, notes, and snippets.

View GEMISIS's full-sized avatar

Gerald McAlister GEMISIS

View GitHub Profile
@GEMISIS
GEMISIS / keybase.md
Created May 26, 2015 22:16
keybase.md

Keybase proof

I hereby claim:

  • I am gemisis on github.
  • I am gemisis (https://keybase.io/gemisis) on keybase.
  • I have a public key whose fingerprint is 27E7 0F84 1A4B 49B7 BFCF FE16 92BB 6EBE 1E4E 1FAA

To claim this, I am signing this object:

@GEMISIS
GEMISIS / andpic.bat
Created November 16, 2015 23:32
Useful batch script for capturing android pictures while in virtual reality. Waits 5 seconds (so you can put your headset on), plays a tone, then saves the picture.
@echo off
timeout 5
@echo 
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2%
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%
@echo off
set /p ip="Enter IP Address: " %=%
echo Setting up wireless debugging with IP Address %ip%...
adb tcpip 5555
adb connect %ip%
echo done!
pause
@GEMISIS
GEMISIS / adb_wireless
Created August 11, 2019 05:28
Quick function to enable wireless adb connections for android devices. Disable with "adb usb".
function adb_wireless() {
ip_address=$(adb shell ip route | awk '{print $9}')
adb tcpip 5555
adb connect $ip_address:5555
}
@GEMISIS
GEMISIS / ScreenFade.cs
Last active September 24, 2019 20:10
Custom fade script for use with the Oculus SDK. Handles fading in and out, as well as custom callbacks for when fading completes.
/************************************************************************************
Copyright : Copyright 2014 Oculus VR, LLC. All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.3 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
@GEMISIS
GEMISIS / adb_wireless.bat
Created April 12, 2020 03:19
Setup an Android devices to be usable over a wireless connection instead.
@echo off
for /F "tokens=* USEBACKQ" %%F in (`adb shell getprop ro.product.model`) do (
set device_name=%%F
)
for /F "tokens=9 USEBACKQ" %%F in (`adb shell ip route`) do (
set ip_addr=%%F
)
echo Setting up wireless debugging for %device_name% at %ip_addr%...
adb tcpip 5555
adb connect %ip_addr%:5555
@GEMISIS
GEMISIS / BuildAssetBundles.cs
Last active May 24, 2020 05:20
A simple script for creating and deploying Asset Bundles in Unity to Oculus builds. Currently just has 2 Asset Bundles: scenes and assets. You can update the menu items for Deploying to support alternatives as necessary.
using System;
using System.IO;
using System.Threading;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
namespace RGBSchemes
{
public class BuildAssetBundles : MonoBehaviour
@GEMISIS
GEMISIS / vid-2-gif.bat
Last active June 28, 2020 15:12
Usage: **vid-2-gif.bat input.mp4** Takes a video input and converts it into a nice, small gif. Note that you'll want to keep the video size fairly small, otherwise the gif could turn out huge! Requires FFMPEG to use!
@echo off
if [%1]==[] goto :error1
:post
set output="%~n1.gif"
echo Creating %output%...
ffmpeg -i %1 -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" %output%
goto :done
:error1
@GEMISIS
GEMISIS / WorldSettings.cs
Last active July 7, 2020 01:39
Handles pausing and resuming for the Oculus platform.
using System.IO;
using UnityEngine;
using UnityEngine.Events;
#if PLATFORM_ANDROID
using UnityEngine.Android;
#endif
public class WorldSettings : MonoBehaviour
{
/// <summary>
@GEMISIS
GEMISIS / wonderful-unity-assets.md
Last active September 18, 2020 09:09
A list of awesome Unity assets everyone should check out!