Skip to content

Instantly share code, notes, and snippets.

View digiwombat's full-sized avatar
🚽

Randall Fitzgerald digiwombat

🚽
View GitHub Profile
@digiwombat
digiwombat / GraphPenaltySetter.cs
Last active April 18, 2024 06:09
Graph Penalty Setter for AStar
using UnityEngine;
using Pathfinding;
[Pathfinding.Util.Preserve]
public class GraphPenaltySetter : GridGraphRule
{
public LayerMask _layerMask;
public int penalty = 10000;
public override void Register(GridGraphRules rules)
@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)
@digiwombat
digiwombat / server.cpp
Created May 22, 2023 17:17
Customized llama.cpp to fix proxy issues somewhat.
#include <httplib.h>
#include <json.hpp>
#include "common.h"
#include "llama.h"
struct server_params
{
std::string hostname = "127.0.0.1";
int32_t port = 8080;
};
@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 / llamacpp_model_alternative.py
Created April 9, 2023 02:38
Modified llamacpp chat class (mildly edited from the original to fit text-gen-webui)
import sys
from time import time
from os import cpu_count
import llama_cpp
from modules.llamacpp_common import GptParams, gpt_params_parse, gpt_random_prompt
from modules import shared
ANSI_COLOR_RESET = "\x1b[0m"
@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
@digiwombat
digiwombat / SizedFoldoutGroupAttribute.cs
Created February 12, 2021 05:01
SizedFoldoutGroup Attribute for Odin Inspector
namespace Sirenix.OdinInspector
{
#pragma warning disable
using System;
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[System.Diagnostics.Conditional("UNITY_EDITOR")]
public class SizedFoldoutGroupAttribute : PropertyGroupAttribute
{
@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==