Skip to content

Instantly share code, notes, and snippets.

@partlyhuman
partlyhuman / GotoScene.cs
Last active May 27, 2021 01:22
Unity Keyboard Scene Switcher
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEditor.SceneManagement;
namespace com.hololabs.editor
{
public static class GotoScene
{
@partlyhuman
partlyhuman / EnumIndexedArray.cs
Created October 27, 2017 19:34
Helpful labels for serialized arrays accessed by enum types
using System;
using System.Text.RegularExpressions;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace com.hololabs
{
@partlyhuman
partlyhuman / EmbeddedAnimationClipUtility.cs
Created October 26, 2017 20:37
Work with Animation Clips embedded in an AnimatorController asset
using System.Linq;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
namespace com.hololabs
{
public static class EmbeddedAnimationClipUtility
{
[MenuItem("Assets/Add Embedded Animation Clip", false)]
@partlyhuman
partlyhuman / FindByGuid.cs
Last active November 21, 2023 14:53
Unity Find by GUID
using UnityEditor;
using UnityEngine;
namespace com.hololabs.editor
{
public class FindByGuid : EditorWindow
{
[MenuItem("Utility/Find Asset by Guid %&g")]
public static void DoFindByGuidMenu()
{
@partlyhuman
partlyhuman / UnityNotNull.cs
Last active February 23, 2019 00:58
[UnityNotNull] attribute
using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
namespace com.partlyhuman
@partlyhuman
partlyhuman / Timestamp
Created June 3, 2015 18:03
Type timestamp in YYYYMMDD when you hit Ctrl+Win+Alt+D
#!^d::
FormatTime, Timestamp,, yyyyMMdd
SendInput, %Timestamp%
return
@partlyhuman
partlyhuman / index.html
Created January 10, 2015 22:29
TrelloTask
<html>
<head>
<title></title>
<style type="text/css">
body {
background-color: black;
color: white;
}
.select {
position: absolute;
@partlyhuman
partlyhuman / pebble-jsapi-local.js
Created November 14, 2013 23:42
Seed of a local testing harness for quick iteration of PebbleJS apps. Could add to this providing a way to simulate appmessages, etc.
var Pebble = new (function(){
var dispatchTable = {};
this.addEventListener = function(eventName, delegate) {
if (!(eventName in dispatchTable)) dispatchTable[eventName] = [];
dispatchTable[eventName].push(delegate);
}
this.dispatchEvent = function(event) {
@partlyhuman
partlyhuman / tallytasks.rb
Created March 26, 2013 06:01
Convert a sequence of hourly tasks and a regular work week into due dates.
#!/usr/bin/env ruby
require 'date'
class Date
def workday?
return !(self.saturday? or self.sunday?)
end
end
def tally_tasks(hrs_per_day, start_date=nil)
@partlyhuman
partlyhuman / private.xml
Created November 29, 2012 02:55
KeyRemap4MacBook setting to complete pending close-parens/quotes/brackets, insert semicolon, enter.
<?xml version="1.0"?>
<root>
<item>
<name>- XCode Custom Keys -</name>
<item>
<name>Fn+Return completes line with semicolon only in XCode</name>
<identifier>private.xcode.completeline</identifier>
<only>XCODE</only>
<autogen>
--KeyToKey--