Skip to content

Instantly share code, notes, and snippets.

@partlyhuman
partlyhuman / Controllers.py
Last active Feb 17, 2021
Pico-8 Pad stuff
View Controllers.py
# 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 / 00-overview.md
Last active Apr 28, 2021
Retropie cloud saves
View 00-overview.md

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 / sdl_controllers.txt
Created Feb 8, 2021
Kite Circuit Sword SDL controller map
View sdl_controllers.txt
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,
View 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 / ScrollToSelected.cs
Created Jun 20, 2019
Unity Scroll to Selected by Asher Vollmer
View ScrollToSelected.cs
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 / unity-find-usages.sh
Created Jan 9, 2018
Find all references to Unity object
View unity-find-usages.sh
#!/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 / GotoScene.cs
Last active May 27, 2021
Unity Keyboard Scene Switcher
View GotoScene.cs
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 Oct 27, 2017
Helpful labels for serialized arrays accessed by enum types
View EnumIndexedArray.cs
using System;
using System.Text.RegularExpressions;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace com.hololabs
{
@partlyhuman
partlyhuman / EmbeddedAnimationClipUtility.cs
Created Oct 26, 2017
Work with Animation Clips embedded in an AnimatorController asset
View EmbeddedAnimationClipUtility.cs
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 May 25, 2021
Unity Find by GUID
View FindByGuid.cs
using UnityEditor;
using UnityEngine;
namespace com.hololabs.editor
{
public class FindByGuid : EditorWindow
{
[MenuItem("Utility/Find Asset by Guid %&g")]
public static void DoFindByGuidMenu()
{