Skip to content

Instantly share code, notes, and snippets.

View jeniferirwin's full-sized avatar

Jenifer Irwin jeniferirwin

  • Ohio
  • 13:24 (UTC -04:00)
View GitHub Profile
@jeniferirwin
jeniferirwin / gist:1763faaeab91da1b098d978169af2d69
Last active June 6, 2024 03:05
PuTTY-like Numpad/Keypad Mapping for Windows Terminal 1.16 (written specifically for TinTin++ compatibility)
# I wrote these mappings when I wanted to migrate from using PuTTY to using
# Windows Terminal. Originally, all of my TinTin++ numpad macros were broken
# because the numpad acts differently in WT by default. These remappings
# make the keypad act like it did in PuTTY.
#
# This has only been tested for TinTin++. I don't really use the keypad in other
# programs, so I don't know if this breaks the functionality elsewhere.
#
# In Windows Terminal, open the Settings tab. In the lower left, you
# can 'Open JSON File'. Add the following lines to the 'actions' section.
@jeniferirwin
jeniferirwin / RandomizedObjectPool.cs
Last active August 26, 2020 20:24
Unity component for an object pool that randomizes itself
using UnityEngine;
using System.Collections.Generic;
public class RandomizedObjectPool : MonoBehaviour
{
public GameObject[] objectPrefabs;
public int initObjectAmount;
private List<GameObject> objectPool = new List<GameObject>();
private void Start()
@jeniferirwin
jeniferirwin / Shuffle.cs
Created July 31, 2020 11:28
Shuffle function for Unity, primarily intended for object pools.
/// <summary>
/// This is used for when we're working with an object pool that has
/// a variety of randomized objects and is not seeing frequent heavy use.
///
/// For cases where the object pool has randomized elements (such as
/// enemies with different stats), working with that pool has the
/// possibility of just returning the same exact object every time we
/// request an object from it. For random spawns, we don't want this.
///
/// Shuffle is used to randomly reorder an object pool so that this doesn't
@jeniferirwin
jeniferirwin / MonoSingleton.cs
Created July 31, 2020 10:56
MonoSingleton snippet from the Unity C# Survival Guide
using UnityEngine;
/// <summary>
/// Quickly turns any Unity MonoBehaviour into a singleton.
///
/// Example of how to implement. Change the class declaration at the top
/// of a new Unity C# script to look similar to this ('SpawnManager' is
/// just an example, it should be whatever you've named the class):
///
/// public class SpawnManager : MonoSingleton<SpawnManager>