Skip to content

Instantly share code, notes, and snippets.

@Aurumaker72
Aurumaker72 / decrypt-lifted.js
Created March 28, 2024 22:07
RPG Maker VX Ace lifted decrypter
var fs = require("fs");
let decryptionAESKey =
"02f3ffa287f78ba68c60f24f79c6fb18ce32b4ebaadac11af5ace8c67a50ae9f";
Decrypter = {};
Decrypter._headerlength = 16;
Decrypter._encryptionKey = "";
Decrypter.SIGNATURE = "5250474d56000000";
Decrypter.VER = "000301";
Decrypter.REMAIN = "0000000000";
using System.Runtime.InteropServices;
namespace M64RPFW.Models.Helpers;
/// <summary>
/// Marks a pseudo-<see cref="DllImportAttribute"/>ed function resolved at runtime.
///
/// <para>
/// To register correctly, a <c>RuntimeDllImport</c>ed delegate must either
/// set the <see cref="Name"/> property or start with a capital <c>D</c>.
@Aurumaker72
Aurumaker72 / thing.cpp
Last active October 24, 2023 15:25
Recursively find all files under directory
std::vector<std::string> get_files_in_subdirectories(
const std::string &directory)
{
std::string newdir = directory;
if (directory.back() != '\0')
{
newdir.push_back('\0');
}
WIN32_FIND_DATA find_file_data;
@Aurumaker72
Aurumaker72 / SkiaCanvas.cs
Last active March 1, 2024 06:20
SkiaCanvas for Avalonia 11
public class SkiaRenderEventArgs : EventArgs
{
public SkiaCanvas Sender { get; init; }
public SKCanvas Canvas { get; init; }
}
public class SkiaCanvas : UserControl
{
private class SkiaCallbackRenderOperation : ICustomDrawOperation
{
@Aurumaker72
Aurumaker72 / LocalStorageStore
Created June 28, 2023 19:28
Svelte LocalStorageStore
import type {Writable} from "svelte/store";
import {writable} from "svelte/store";
export function lsWritable<T>(path: string, default_value: T): Writable<T> {
const store = writable<T>(localStorage.getItem(path) ? JSON.parse(localStorage.getItem(path)) as T : default_value);
store.subscribe(x => {
localStorage.setItem(path, JSON.stringify(x));
});
return store;
}
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Platform;
using Avalonia.Rendering.SceneGraph;
using Avalonia.Skia;
using Avalonia.Threading;
using SkiaSharp;
namespace M64RPFW.Views.Avalonia.Controls;
@Aurumaker72
Aurumaker72 / sound_pool.c
Created April 7, 2023 20:40
Raylib sound pool
#include "sound_pool.h"
t_sound_pool *create_sound_pool(const char *path, int size) {
t_sound_pool * soundPool = (t_sound_pool*)MemAlloc(sizeof(t_sound_pool));
soundPool->current_index = 0;
soundPool->size = size;
soundPool->sounds = (Sound*)MemAlloc(sizeof(Sound) * size);
@Aurumaker72
Aurumaker72 / ArrayExtensions.cs
Last active March 13, 2023 16:21
Multi-dimensional array slicing
public static class ArrayExtensions
{
public static T[] GetColumn<T>(this T[,] matrix, int columnNumber)
{
return Enumerable.Range(0, matrix.GetLength(0))
.Select(x => matrix[x, columnNumber])
.ToArray();
}
@Aurumaker72
Aurumaker72 / BigFormatterService.ts
Created March 10, 2023 17:41
Cookie Clicker Number Formatting for TS
import type { INumberFormatterService } from "../services/INumberFormatterService";
export class BigFormatterService implements INumberFormatterService {
private static formatLong: string[] = [' thousand', ' million', ' billion', ' trillion', ' quadrillion', ' quintillion', ' sextillion', ' septillion', ' octillion', ' nonillion'];
private static prefixes = ['', 'un', 'duo', 'tre', 'quattuor', 'quin', 'sex', 'septen', 'octo', 'novem'];
private static suffixes = ['decillion', 'vigintillion', 'trigintillion', 'quadragintillion', 'quinquagintillion', 'sexagintillion', 'septuagintillion', 'octogintillion', 'nonagintillion'];
constructor() {
for (var i in BigFormatterService.suffixes) {
@Aurumaker72
Aurumaker72 / firebase.json
Created March 7, 2023 18:02
firebase.json configuration for Svelte SPA
{
"hosting": {
"public": "dist/",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]