Skip to content

Instantly share code, notes, and snippets.

View digiwombat's full-sized avatar
🚽

Randall Fitzgerald digiwombat

🚽
View GitHub Profile
@digiwombat
digiwombat / SizedBoxGroupAttribute.cs
Created July 7, 2024 14:34
SizedBoxGroup Attribute for Odin Inspector
namespace Sirenix.OdinInspector
{
#pragma warning disable
using System;
using UnityEngine;
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[System.Diagnostics.Conditional("UNITY_EDITOR")]
public class SizedBoxGroupAttribute : PropertyGroupAttribute
@digiwombat
digiwombat / rename_branches.sh
Created May 6, 2023 20:23
A bash script which renames branches recursively.
#!/bin/env bash
# This script is public domain.
# If your government doesn't allow that, it doesn't matter. What're they gonna do? Sue me?
# Just a useful script for changing the name of your repo.
# Variables
ROOT_FOLDER=~/
OLD=${1:-main}
NEW=${2:-master}
@digiwombat
digiwombat / OrgChartLayout.cs
Last active March 18, 2023 16:55
An Org Chart Layout function
private float HorizontalSpacing => canvasRectWidth * 0.3f; // The horizontal spacing between nodes
private float VerticalSpacing => canvasRectHeight + 24; // The vertical spacing between nodes
private HashSet<DialogueEntry> visited = new();
private HashSet<DialogueEntry> subtreeVisited = new();
private HashSet<DialogueEntry> subtreeWidthAdded = new();
private Dictionary<DialogueEntry, float> subTreeWidths = new();
private void ArrangeNodes()
{
CalculatePositions(currentConversation.dialogueEntries[0], 0, 0);
@digiwombat
digiwombat / PotatoHider.user.js
Last active February 15, 2023 06:25
Hider for potatoes.
// ==UserScript==
// @name Potato Hider
// @description Hides them numbers.
// @version 0.6
// @match https://www.twitch.tv/videos*
// @match https://www.twitch.tv/*/videos*
// @match https://www.twitch.tv/directory/following/videos*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js
// @grant none
// ==/UserScript==
@digiwombat
digiwombat / LAMFix.user.js
Created February 11, 2022 02:20
Fixer for LostArkMap
// ==UserScript==
// @name Lost Ark Fixer
// @namespace https://lostarkmap.com/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://lostarkmap.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=lostarkmap.com
// @grant GM_addStyle
// ==/UserScript==
@digiwombat
digiwombat / JitterFreeLit.shader
Created January 25, 2022 04:07
URP 2D Lit Smooth Pixel Scaling
Shader "Sprites/JitterFreeLit"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
_MaskTex("Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color("Tint", Color) = (1,1,1,1)
public class DialogueParserExample : MonoBehaviour
{
public static string FilterText(string text)
{
const string genderStartTag = "[g=";
const int maxReplacements = 100;
if (text.Contains(genderStartTag))
{
using PixelCrushers.DialogueSystem.SuperTextMeshSupport;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SequenceSubtitlePanel : SuperTextMeshSubtitlePanel
{
public override void Open()
{
@digiwombat
digiwombat / SizedFoldoutGroupAttribute.cs
Last active July 7, 2024 14:30
SizedFoldoutGroup Attribute for Odin Inspector
namespace Sirenix.OdinInspector
{
#pragma warning disable
using System;
using UnityEngine;
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[System.Diagnostics.Conditional("UNITY_EDITOR")]
public class SizedFoldoutGroupAttribute : PropertyGroupAttribute
@digiwombat
digiwombat / YouTubeSubscriptionRedirect.user.js
Last active March 24, 2023 22:25
YouTube Subscription Redirect
// ==UserScript==
// @name YouTube Subscription Redirect
// @description Automatically load the videos you actually care about
// @namespace B492B7DC-4C33-4E72-8316-49A425788F86
// @version 2.5
// @match *://www.youtube.com/*
// @run-at document-end
// @grant none
// @license MIT
// @updateURL https://gist.github.com/digiwombat/1d3a7b2b38ab6cd198b8714458550215/raw/YouTubeSubscriptionRedirect.user.js