Skip to content

Instantly share code, notes, and snippets.

View nkrapivin's full-sized avatar
🐱
exactly.

Nikita Krapivin nkrapivin

🐱
exactly.
View GitHub Profile
@nkrapivin
nkrapivin / Rutranslit.gml
Last active November 26, 2021 13:50
Rutranslit GML library
/// @function Rutranslit([useSoftSigns])
/// @param {bool} [useSoftSigns] (optional) true - Translit soft signs, false - ignore them.
/// @description This class allows you to convert Russian strings to English translit.
/// @returns {Rutranslit} self
function Rutranslit(useSoftSigns) constructor {
// private:
m_lookup = undefined;
/// @description (private) Initializes the lookup table.
@nkrapivin
nkrapivin / cursed.cs
Created September 26, 2021 15:40
fnames to pascal case thing
// See https://aka.ms/new-console-template for more information
var namespath = @"C:\ProgramData\GameMakerStudio2-Dev\Cache\runtimes\runtime-9.9.1.2226\fnames";
var lines = File.ReadAllLines(namespath);
var specchars = new[] { '#', '*', '@', '&', '$', '£', '!', '%', '?', '[', '(' };
Console.WriteLine("// copy and paste me into your game:");
foreach (var sline in lines)
{
@nkrapivin
nkrapivin / Program.cs
Last active July 19, 2021 16:58
Zeus Linux IDE patcher
/*! how to compile: `csc Program.cs -r:Mono.Cecil.dll`
* how to use: `mono Program.exe /opt/GameMakerStudio2/IDE.dll`
* OR, FOR RED: `mono Program.exe /opt/GameMakerStudio2-Dev/IDE.dll`
*
* the Cecil dll can be obtained manually from NuGet. (which is what I did)
* thanks to YoYo not obfuscating Linux builds, we can easily do our funky stuff.
*
* also hi to all YoYo employees reading this, please take care of yourself, hydrate,
* go outside (in a mask), take breaks from work, and don't patch this program, or I will become vewy sad :<
*/
@nkrapivin
nkrapivin / GMHandshake.cs
Created May 31, 2021 15:53
GameMaker network handshake implementation.
#nullable enable
using System;
using System.Net.Sockets;
using System.Runtime.Serialization;
using System.Text;
namespace nkrapivindev
{
/// <summary>
@nkrapivin
nkrapivin / gist:f3118d1396000979db1f2c2eaf43309e
Last active November 26, 2021 18:33
undocumented debug_event stuff
some may only work on Linux, or only on consoles...
usage: debug_event("thing here");
DumpMemory - prints the amount of allocated memory to console (Total memory used 0xblabla bytes)
CheckGLError - I assume it's supposed to ignore OpenGL errors? But it seems to be unused lol.
VMTraceOn - sets g_fVMDebug to true
VMTraceOff - sets that variable to false