Skip to content

Instantly share code, notes, and snippets.

View MrPowerGamerBR's full-sized avatar
:shipit:
We facepalm, we shrug and we hack around it and never look back.

MrPowerGamerBR MrPowerGamerBR

:shipit:
We facepalm, we shrug and we hack around it and never look back.
View GitHub Profile
@MrPowerGamerBR
MrPowerGamerBR / kwin_wayland.log
Last active July 17, 2025 19:24
KDE Plasma KWin crash
jul 17 14:54:37 deeparch-whistler plasmashell[1114]: error marshalling arguments for import_timeline: dup failed: Muitos arquivos abertos
jul 17 14:54:37 deeparch-whistler plasmashell[1114]: Error marshalling request: Muitos arquivos abertos
jul 17 14:54:37 deeparch-whistler plasmashell[1114]: qt.qpa.wayland: eglSwapBuffers failed with 0x3000, surface: 0x55c994d1e7a0
jul 17 14:54:37 deeparch-whistler plasmashell[1114]: The Wayland connection experienced a fatal error: Muitos arquivos abertos
jul 17 14:54:37 deeparch-whistler kwin_wayland_wrapper[957]: KCrash: Application 'kwin_wayland' crashing... crashRecursionCounter = 2
jul 17 14:54:37 deeparch-whistler systemd-coredump[83765]: Process 957 (kwin_wayland) of user 1000 terminated abnormally with signal 11/SEGV, processing...
jul 17 14:54:37 deeparch-whistler systemd[1]: Created slice Slice /system/drkonqi-coredump-processor.
jul 17 14:54:37 deeparch-whistler systemd[1]: Created slice Slice /system/systemd-coredump.
jul 17 14:54:37 deeparch-whistler systemd[1
@MrPowerGamerBR
MrPowerGamerBR / 0001-Fix-vegas-9.0-An-necessary-operation-is-not-implemen.patch
Created July 17, 2025 04:06
Fix vegas 9.0 "An necessary operation is not implemented" in Wine (hacky)
From 44fb564431393c4f5f86046d083ec0cd09b9dd54 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <[email protected]>
Date: Thu, 17 Jul 2025 01:04:46 -0300
Subject: [PATCH] Fix vegas 9.0 "An necessary operation is not implemented"
---
dlls/wiaservc/wiadevmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wiaservc/wiadevmgr.c b/dlls/wiaservc/wiadevmgr.c
@MrPowerGamerBR
MrPowerGamerBR / FontGeneratorCompute.kt
Last active July 9, 2025 19:10
SDF rendering things
package net.perfectdreams.lookatmycursor
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.encodeToStream
import net.perfectdreams.harmony.gl.debug.OpenGLDebugging
import net.perfectdreams.harmony.gl.shaders.ShaderManager
import net.perfectdreams.harmony.gl.textures.TextureManager
import net.perfectdreams.harmony.logging.HarmonyLoggerFactory
import net.perfectdreams.harmony.logging.slf4j.HarmonyLoggerCreatorSLF4J
import org.lwjgl.BufferUtils
@MrPowerGamerBR
MrPowerGamerBR / sdf_gen.glsl
Last active July 1, 2025 21:16
SDF (Signed Distance Field) compute shader
#version 430 core
layout(local_size_x = 16, local_size_y = 16) in;
layout(rgba8, binding = 0) uniform image2D inputImage;
layout(rgba8, binding = 1) uniform image2D outputTexture;
uniform int searchRadius = 32;
void main() {
ivec2 pixelCoords = ivec2(gl_GlobalInvocationID.xy);
@MrPowerGamerBR
MrPowerGamerBR / DiscordExperimentHash.kt
Created May 14, 2025 23:38
A port of Discord's experiment hash calculation (ported by Gemini 2.5 Pro with some fixes thx Gemini xoxoxo)
package net.perfectdreams.loritta.morenitta
import kotlinx.io.bytestring.encodeToByteString
import java.nio.ByteBuffer
import java.nio.ByteOrder
// Constants used in the MurmurHash3 algorithm
// These are the 32-bit patterns. Using .toInt() correctly captures their signed representation if needed.
private const val C1_INT: Int = 0xCC9E2D51.toInt() // JavaScript: 3432918353
private const val C2_INT: Int = 0x1B873593.toInt() // JavaScript: 461845907
@MrPowerGamerBR
MrPowerGamerBR / CustomContentEntryRoute.kt
Last active March 13, 2025 04:25
SneakySims' The Sims 1 Skin Renderer (frontend & backend)
package net.sneakysims.website.routes
import io.ktor.server.application.*
import io.ktor.server.html.*
import io.ktor.server.response.*
import io.ktor.server.util.*
import kotlinx.serialization.json.Json
import net.perfectdreams.sequins.ktor.BaseRoute
import net.sneakysims.sneakylib.cmx.CMX
import net.sneakysims.sneakylib.skn.SKN
@MrPowerGamerBR
MrPowerGamerBR / BinaryUtils.kt
Created February 22, 2025 13:37
FAR 1a (The Sims 1) and FAR 1b (The Sims Online) reader/writer
package net.perfectdreams.simslib.utils
object BinaryUtils {
/**
* Extracts two bytes from a UShort [value]
*
* @param value the input
* @return a list containing two UBytes
*/
fun shortToUBytes(value: UShort): List<UByte> {
@MrPowerGamerBR
MrPowerGamerBR / ByteArrayReader.kt
Created February 17, 2025 21:08
The Sims 1 FAR Read/Writer in Kotlin
package net.perfectdreams.simslib.utils
/**
* A reader that reads a ByteArray, similar to Java's ByteBuffer
*
* We don't use kotlinx.io's Buffer because it doesn't support rewinding
*/
class ByteArrayReader(val byteArray: ByteArray) {
var position = 0
import java.io.BufferedInputStream
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
import java.util.*
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
private fun extractFolder(zipFile: String, extractFolder: String) {
try {
@MrPowerGamerBR
MrPowerGamerBR / BlockPacketAdapter.kt
Last active June 5, 2023 10:05
Example of how to replace blocks in 1.18 chunk data, single block change and multi block change packets.
package net.perfectdreams.dreamcustomitems.blocks
import com.comphenix.packetwrapper.WrapperPlayServerBlockChange
import com.comphenix.protocol.PacketType
import com.comphenix.protocol.events.*
import com.comphenix.protocol.wrappers.WrappedBlockData
import com.viaversion.viaversion.api.minecraft.chunks.PaletteType
import com.viaversion.viaversion.api.type.types.version.ChunkSectionType1_18
import io.netty.buffer.Unpooled
import net.minecraft.core.Registry