Wednesday, May 27, 2026

Define initial directory in Git Bash

After installing Git on my new Windows 10 IoT LTSC, as always the default directory of Git Bash is home. It is, however, rather easy to change this behavior.

Right-click the Git Bash shortcut to open its properties, and:

  • Target: remove the --cd-to-home suffix; and
  • Start in: replace %HOMEDRIVE%%HOMEPATH% with whathever folder you want.

Monday, May 25, 2026

Make Firefox fast again

Still on my new Windows 10 IoT LTSC setup, I found a page which seems to have a large amount of Firefox tweaks. I’ve tried most of them, and honestly I didn’t notice any improvement, but I hope it pays off in the long term:

Sunday, May 24, 2026

Disable Win global hotkeys

Today I installed a new 1 TB SSD drive, since my old 120 GB one capacity was out of control. Windows 10 IoT LTSC was the OS of my choice, along with the incredibly smooth massgrave.dev aid.

One thing that didn’t work was the global shortcuts of foobar2000.. At first I thought it could be related to the newer 64-bit version I finally installed, but ChatGPT – first time on this blog – told me that IoT LTSC is stricter about hijacking Win hotkeys. And it gave me directions on how to disable them globally, which I didn’t even know it was possible. Create a new key under:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
  • New, String Value
  • DisabledHotkeys
  • AS

The above will disable Win+A and Win+S global hotkeys, which is amazing.

Tuesday, April 7, 2026

Reusing code in const and non-const methods, C++17

I found the code below from this great answer in StackOverflow. It allows you to implement the const method with your logic, then use this one-liner to implement the non-const method. It’s a trick from the great Scott Meyers:

const T& f() const {
	return something_complicated();
}

T& f() {
	return const_cast<T&>(std::as_const(*this).f());
}

I’m using this thing everywhere.

Thursday, April 2, 2026

Project templates in Visual Studio 2022

After configuring C and C++ projects countless times, base on these settings, I finally bit the bullet and created a reusable template in Visual Studio 2022. And it’s surprisingly simple: create the project and then go Project → Export Template.

The project name itself can be used inside files with $safeprojectname$ string. In order to have it replaced even inside .rc files, edit the .vstemplate and add:

<TemplateContent>
  <Project TargetFileName="ayylmao.vcxproj" File="ayylmao.vcxproj" ReplaceParameters="true">
    <ProjectItem ReplaceParameters="true">RES\$safeprojectname$.rc</ProjectItem>
  </Project>
</TemplateContent>

There’s no GUI for deleting a template, though. One must manually remove the zip files from two different locations:

  • Documents \ My Exported Templates
  • Documents \ Templates \ Project Templates

To restore a template, simply copy the zip back to:

  • Documents \ Templates \ Project Templates

Sunday, February 15, 2026

The Rust doc_cfg fiasco

In WinSafe, Cargo features are used extensively to gate the DLL modules which are currently implemented. This is good because you specify only the modules you need, reducing your compiler effort. The Rust documentation doc_auto_cfg unstable feature was extemely useful, applying tags on each entity specifying the required feature for it.

Then, at some point of October 2025, doc_auto_cfg was merged into doc_cfg. And it’s now completely broken.

I filled an issue at the official repo. I’m not the only one missing that feature, but no one seems to care. This is so demotivating I stopped WinSafe development completely.

I found a workaround by pinning the compiler version using rust-toolchain.toml, along with the last version where doc_auto_cfg works, which I painfully found out:

[toolchain]
channel = "nightly-2025-09-27"
components = ["rust-docs"]
targets = ["x86_64-pc-windows-msvc"]

With the above file, the command line to generate the docs is:

RUSTDOCFLAGS="--cfg docsrs" cargo doc --all-features

Or even better, directly specify the toolchain the command line:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly-2025-09-27 doc --all-features

This compiler has the 1.92.0-nightly version, and it seems I’m gonna using for a long time.

Update: after 4 months, the bug was finally fixed.