Skip to content

Instantly share code, notes, and snippets.

@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 / rotary_encoder_volume_power.ino
Last active March 12, 2024 19:21
Power/media button for arcade cabinet
//
// Connect a rotary encoder to pins 2, 3, 4
// Made for a MAME cabinet to act as a volume controller
// Adds additional functions when encoder button depressed
//
// Arduino libraries required:
// EncoderTool https://www.arduino.cc/reference/en/libraries/encodertool/
// HID-Project https://www.arduino.cc/reference/en/libraries/hid-project/
//
#include <HID-Project.h>
@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 / rotary_encoder_mame.ino
Created January 5, 2023 18:47
DIY Arcade Spinner with Arduino Pro Micro 5V
#include <Mouse.h>
#include <Keyboard.h>
#include "EncoderTool.h"
#include "Bounce2.h"
using namespace EncoderTool;
// #undef P2 for player 1, #define P2 for player 2
#undef P2
#undef DEBUG
@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
@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 / 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 / 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 / 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):