Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / unity-find-usages.sh
Created January 9, 2018 02:28
Find all references to Unity object
#!/bin/bash
# usage: send path of an asset in. the script will find the GUID from the associated meta file, and look for usages of this GUID anywhere.
# of course only works with text mode (YAML) serialization
GUID=$(grep -Po '(?<=guid: )\w+' $1.meta)
echo "Object has GUID $GUID"
echo "Searching for instances..."
find . \( -name "*.asset" -o -name "*.prefab" -o -name "*.unity" \) -exec grep -l $GUID {} \;
@partlyhuman
partlyhuman / ScrollToSelected.cs
Created June 20, 2019 20:49
Unity Scroll to Selected by Asher Vollmer
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
[RequireComponent( typeof( ScrollRect ) )]
public class ScrollToSelected : MonoBehaviour
{
[ Header( "Required: Children must have a Y Pivot of 1!" ) ]
public float scrollSpeed = 10f;
@partlyhuman
partlyhuman / keybase.md
Created April 21, 2020 23:03
keybase.md

Keybase proof

I hereby claim:

  • I am partlyhuman on github.
  • I am partlyhuman (https://keybase.io/partlyhuman) on keybase.
  • I have a public key ASBkJ-7uTVxhmatuApUtxnlsRFloGr7ww12f_0y-VtyAyQo

To claim this, I am signing this object:

@partlyhuman
partlyhuman / sdl_controllers.txt
Created February 8, 2021 07:13
Kite Circuit Sword SDL controller map
03000000412300003680000001010000,Arduino LLC Arduino Leonardo,platform:Linux,a:b1,b:b0,x:b2,y:b3,back:b5,start:b4,leftshoulder:b6,rightshoulder:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
@partlyhuman
partlyhuman / 00-overview.md
Last active April 10, 2022 20:57
Retropie cloud saves

First, set up a samba server on a machine on your network that's always on. I have a Pi Zero acting as a pi-hole on 10.0.0.2 (see www.pi-hole.net), piggybacking on this. I only mention because the pi-hole project slaps. Your machine can be anything, Windows is great too since it has built in Samba, DLNA all sorts of fun sharing protocols.

To set that up on pi you can follow a guide like https://magpi.raspberrypi.org/articles/samba-file-server. Windows is much easier, just share a folder under Properties, Sharing.

So now I have a server share //10.0.0.2/share with a saves/ subfolder

On every RetroPie device, I now want to do two things:

@partlyhuman
partlyhuman / Controllers.py
Last active February 17, 2021 16:40
Pico-8 Pad stuff
# coding: utf-8
"""
Standard gamepad mappings.
Pulled in to Gamepad.py directly.
"""
class NES(Gamepad):
fullName = 'Pico8 Pad'
def __init__(self, joystickNumber = 0):
@partlyhuman
partlyhuman / PinDefinitionsAndMore.h
Last active February 18, 2022 21:15
Sony TV control via service
/*
* PinDefinitionsAndMore.h
*
* Contains pin definitions for IRremote examples for various platforms
* as well as definitions for feedback LED and tone() and includes
*
* Copyright (C) 2021 Armin Joachimsmeyer
* armin.joachimsmeyer@gmail.com
*
* This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
@partlyhuman
partlyhuman / arduino-pxlr-remote.ino
Created December 31, 2022 20:53
IR Remote for Custom Game Boy Camera ROMs
#undef DEBUG
#define GBP_SO_PIN 3
#define GBP_SC_PIN 4
#define PIN_LED 1
#define PIN_IRIN 0
#define J_START 0x80u
#define J_SELECT 0x40u
#define J_B 0x20u