Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
ericoporto / cleantrailspace.py
Created October 22, 2024 02:14
Python script to clean trailing whitespace, preserving individual line endings
import os
import argparse
import chardet
def is_text_file(filename, chunk_size=1024):
"""Check if the file is likely a text file by reading a small chunk."""
try:
with open(filename, 'rb') as f:
chunk = f.read(chunk_size)
# Use chardet to detect encoding and ensure it's text-like
@ericoporto
ericoporto / glob_match.cc
Created July 20, 2024 14:10 — forked from alco/glob_match.cc
A translation of Python's fnmatch function into C++
#include <string>
#include "regex.h"
/*
* Return a new string with all occurrences of 'from' replaced with 'to'
*/
std::string replace_all(const std::string &str, const char *from, const char *to)
{
std::string result(str);
.\test\runner browser.test_sdl2_mixer_music_mp3
Test suites:
['test_browser']
Running test_browser: (1 tests)
(checking sanity from test runner)
shared:INFO: (Emscripten: Running sanity checks)
[Browser harness server on process 19864]
common:INFO: Launching browser: ['C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe']
Running the browser tests. Make sure the browser allows popups from localhost.
@ericoporto
ericoporto / error_log.txt
Created February 25, 2024 17:26
fail to run sdl2_mixer test
.\test\runner browser.test_sdl2_*
Test suites:
['test_browser']
Running test_browser: (48 tests)
(checking sanity from test runner)
shared:INFO: (Emscripten: Running sanity checks)
[Browser harness server on process 17704]
common:INFO: Launching browser: ['C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe']
Running the browser tests. Make sure the browser allows popups from localhost.
.\test\runner browser.test_sdl2_*
Test suites:
['test_browser']
Running test_browser: (48 tests)
(checking sanity from test runner)
shared:INFO: (Emscripten: Running sanity checks)
[Browser harness server on process 6876]
common:INFO: Launching browser: ['C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe']
Running the browser tests. Make sure the browser allows popups from localhost.
@ericoporto
ericoporto / dav1dmsys2error.log
Last active September 30, 2023 16:17
dav1d error in msys2
[82/107] Compiling C object tests/checkasm.exe.p/checkasm_checkasm.c.obj
FAILED: tests/checkasm.exe.p/checkasm_checkasm.c.obj
"cc" "-Itests/checkasm.exe.p" "-Itests" "-I../tests" "-I." "-I.." "-Iinclude/dav1d" "-I../include/dav1d" "-Iinclude" "-I../include" "-fdiagnostics-color=always" "-DNDEBUG" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-std=c99" "-O3" "-fvisibility=hidden" "-Wundef" "-Werror=vla" "-Wno-maybe-uninitialized" "-Wno-missing-field-initializers" "-Wno-unused-parameter" "-Wstrict-prototypes" "-Werror=missing-prototypes" "-fomit-frame-pointer" "-ffast-math" -MD -MQ tests/checkasm.exe.p/checkasm_checkasm.c.obj -MF "tests/checkasm.exe.p/checkasm_checkasm.c.obj.d" -o tests/checkasm.exe.p/checkasm_checkasm.c.obj "-c" ../tests/checkasm/checkasm.c
../tests/checkasm/checkasm.c: In function ΓÇÿsignal_handlerΓÇÖ:
../tests/checkasm/checkasm.c:504:29: error: variable ΓÇÿdefault_saΓÇÖ has initializer but incomplete type
504 | static const struct sigaction default_sa = { .sa_handler
@ericoporto
ericoporto / issue_sketch.md
Created September 29, 2023 21:25
issues sketch

Describe the problem

The Dialog Scripts are great for writing dialog lines. But sometimes one wants to handle the logic of which dialog to run from elsewhere, like a Room Script. For a character that only exists in a room, or for a particular scene, it's useful to hold all dialogs in the same dialog script, so one doesn't have to open many different dialog scripts.


Suggested change

If possible to either add a parameter in dialog start or create a new dialog.Run(int x).

@ericoporto
ericoporto / cirrus.log
Created August 31, 2023 17:15
Log cirrus Gradle time-out
cd Android && ./and-build.sh build_debug
building debug library and runtime...
/tmp/cirrus-ci-build/Android /tmp/cirrus-ci-build/Android
/tmp/cirrus-ci-build/Android/agsplayer /tmp/cirrus-ci-build/Android /tmp/cirrus-ci-build/Android
Downloading https://services.gradle.org/distributions/gradle-8.3-bin.zip
............10%............20%.............30%............40%.............50%............60%.............70%............80%.............90%............100%
Welcome to Gradle 8.3!
Here are the highlights of this release:
Error: Object reference not set to an instance of an object.
Version: AGS 3.6.0.48
System.NullReferenceException: Object reference not set to an instance of an object.
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetDockState(Boolean isHidden, DockState visibleState, DockPane oldPane)
at WeifenLuo.WinFormsUI.Docking.DockContent.Hide()
at AGS.Editor.WindowsMenuManager.DockPane_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.set_CheckState(CheckState value)
at System.Windows.Forms.ToolStripMenuItem.set_Checked(Boolean value)