Skip to content

Instantly share code, notes, and snippets.

View ryuukk's full-sized avatar

ryuukk

View GitHub Profile
  • put this after the block for: -- active shortcut
			-- all shortcut
			sx = x + width - (16*3) - (2*3)
			SetDrawColor(1,1,1)
			if allHover then
				DrawImage(icon_sort_disabled_hover, sx, y, 16, height)
			else
import core.demangle : demangle;
import core.stdc.string: strlen;
extern(C) int demangle_symbol(const(char*) mangled, char* buffer, size_t bufferLength)
{
if (mangled == null) return 0;
auto ret = demangle( cast(char[]) mangled[0 .. strlen(mangled)], buffer[0 .. bufferLength] );
buffer[ret.length] = 0;
return 1;
}
extern(C) void main()
{
rt_register_crash_handler();
crash_me();
}
void crash_me()
{
int* a;
@ryuukk
ryuukk / bd.d
Created February 10, 2024 12:23
module rt.crash_handler.posix;
import core.stdc.stdlib: free, exit;
import core.stdc.string: strlen, memcpy;
import core.stdc.stdio: fprintf, stderr, sprintf, fgets, fclose, FILE;
import core.sys.posix.unistd: readlink;
import core.sys.posix.signal: SIGUSR1;
import core.sys.posix.stdio: popen, pclose;
import core.sys.linux.execinfo: backtrace, backtrace_symbols;
import core.sys.linux.dlfcn: dladdr1, Dl_info, RTLD_DL_LINKMAP;

before:

$ dmd -run app.d                                                                                                                                                                                                    
app.d(9): Error: function `app.why_do_i_have_to_read_this_long_ass_function_man_useless(int aa)` is not callable using argument types `(string)`
app.d(9):        cannot pass argument `"wrong"` of type `string` to parameter `int aa`
struct InvBoneBindInfo
{
char[64] id = 0;
float sss;
}
HashMapTest!(void*, InvBoneBindInfo[32]) nodePartBones;
# noisy HDD?
``sudo hdparm -S 30 /dev/sda``
This will turn off disk if no activity after (30 * 5) sec
module dsymbol.conversion.third;
import dsymbol.modulecache;
import dsymbol.scope_;
import dsymbol.semantic;
import dsymbol.symbol;
import dsymbol.string_interning;
import dsymbol.deferred;
@ryuukk
ryuukk / chromium-improve-font-rendering.patch
Last active May 9, 2023 15:16
Improve chromium font rendering on linux
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -150,12 +150,19 @@
}
# Settings for text blitting, chosen to approximate the system browser.
- if (is_linux || is_chromeos) {
+ if (is_chromeos) {
defines += [
"SK_GAMMA_EXPONENT=1.2",
void on_pretick(Engine* e)
{
static if (USE_DLL)
{
void unload_dll()
{
FreeLibrary(h);
h = null;
main_loop = null;
dll_ok = false;