Skip to content

Instantly share code, notes, and snippets.

@krypt-lynx
krypt-lynx / jff-csv.cs
Last active July 25, 2020 21:31
Comma Separated Values reader/writer
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace csv
{
static class CSV
{
static BigInteger ProdTree(int l, int r)
{
if (l > r)
return 1;
if (l == r)
return l;
if (r - l == 1)
return (BigInteger)l * r;
int m = (l + r) / 2;
return ProdTree(l, m) * ProdTree(m + 1, r);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VRageMath;
namespace Script
{
#region ingame script start
static class StrUtils
{
static string cRef =
"\n\n\n\n\n" +
"\n'|¦ˉ‘’‚" +
"\nј" +
"\n !I`ijl ¡¨¯´¸ÌÍÎÏìíîïĨĩĪīĮįİıĵĺļľłˆˇ˘˙˚˛˜˝ІЇії‹›∙" +
"\n(),.1:;[]ft{}·ţťŧț" +
"\n\"-rª­ºŀŕŗř" +
"\n*²³¹" +
using Harmony;
using Havok;
using Sandbox.Engine.Physics;
using Sandbox.Game.Entities.Cube;
using System;
using System.Reflection;
using VRage.Plugins;
namespace SpeedLimitFix
{
List<IMyProgrammableBlock> pbs = new List<IMyProgrammableBlock>();
IMyTextPanel status = null;
public Program() {
}
public void Main(string argument) {
this.GridTerminalSystem.GetBlocksOfType<IMyProgrammableBlock>(pbs);
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Publish
{
@krypt-lynx
krypt-lynx / RecacheColumnWidths_prefix.cs
Last active October 3, 2020 00:43
column widths using Cassowary algorithm
static bool RecacheColumnWidths_prefix(PawnTable __instance)
{
ClSimplexSolver solver = new ClSimplexSolver();
solver.AutoSolve = false;
var cachedColumnWidths = (List<float>)typeof(PawnTable)
.GetField("cachedColumnWidths", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue(__instance);
@krypt-lynx
krypt-lynx / FloatSubmenu.cs
Last active February 10, 2021 19:49
Cascading menus implementation for RimWorld game
using RimWorld.Planet;
using RWLayout.alpha2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine;
using Verse;
namespace RWLayoutTests