Skip to content

Instantly share code, notes, and snippets.

@mrudat
mrudat / setup.cmd
Last active June 11, 2022 11:32
Create directory junctions for Beat Saber
@ECHO OFF
FOR /D %%D in ("G:\Modding\Beat Saber\BSLegacyLauncher\Installed Versions\*") DO (
CD %%D
IF EXIST "Beat Saber.exe" (
ECHO Checking setup for %%D
FOR %%F IN (CustomNotes CustomPlatforms CustomSabers DLC Playlists) DO (
IF NOT EXIST %%F (
MKLINK /J %%F "\Steam\steamapps\common\Beat Saber\"%%F
)
@mrudat
mrudat / SQLiteFormKeyAllocator.cs
Last active February 27, 2021 04:34
FormKey allocator using SQLite.
using Mutagen.Bethesda;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace System.Runtime.CompilerServices
@mrudat
mrudat / find barrelling recipes.lua
Created June 14, 2020 14:17
Finds barrelling recipes.
local barrel_name_to_barrel_data
local function build_barrel_name_to_barrel_data()
local barrel_recipe_filters = {
{ filter = "has-ingredient-fluid" },
{ filter = "has-ingredient-item", mode = "and" },
{ filter = "has-product-item", mode = "and" },
{ filter = "has-product-fluid", mode = "and", invert = true },
{ filter = "has-product-fluid", mode = "or" },
{ filter = "has-product-item", mode = "and", },
@mrudat
mrudat / SaveFileSanityTest.java
Last active May 10, 2020 05:23
Does a sanity check of newly created save files (supported by FallrimTools) against the last save file and attempts complains if something looks strange.
/*
* How I compiled this using Eclipse.
* Create a new project in Eclipse
* Unpack the Fallrim Tools/src.7z into the new project.
* Eclipse should start trying to compile things.
* Add all of the jars in Fallrim Tools/Libs using 'Add External JARs...'.
* Paste this file as a new class in restringer/SaveFileSanityTest.java
* Run this class as a java application, and supply your save file directory as the only argument.
*/
@mrudat
mrudat / update-factorio-mod.pl
Last active May 1, 2019 13:06
Does a simple search-and-replace to change some Factorio 0.16 mods to support Factorio 0.17
#!/usr/bin/perl
use warnings;
use strict;
use English qw(:no_match_vars);
use JSON;
use File::Spec;
use File::Path qw(make_path);