Skip to content

Instantly share code, notes, and snippets.

@mistificator
mistificator / enum_magic.h
Created June 18, 2026 23:13
enum_magic.h
#include <iostream>
#include <string>
#include <type_traits>
struct StringRef {
const char* data;
size_t size;
constexpr StringRef() : data(""), size(0) {}
@mistificator
mistificator / collection_cast.h
Created June 18, 2026 22:24
collection_cast.h
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <iterator>
template <
template <typename...> class Container,
typename OldType,
@mistificator
mistificator / repair_qt_in_wsl.sh
Created March 21, 2025 12:21
libQt6Core.so.6
#!/bin/sh
strip --remove-section=.note.ABI-tag libQt6Core.so.6
@mistificator
mistificator / print_all_defined.cmake
Created March 15, 2025 19:45
Print everything defined in CMake project
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
#!/bin/sh
curl -sf -L https://static.rust-lang.org/rustup.sh | sh
@mistificator
mistificator / install-grun.sh
Last active August 26, 2024 20:16
alias for GUI single application run (uses X and TWM)
#!/bin/sh
alias grun="(x &) && (sleep 0.1s) && (twm &) && (sleep 0.1s) &&"
#!/bin/sh
find . -type f -print0 | xargs -0 dos2unix
@mistificator
mistificator / smb.reg
Last active October 25, 2023 14:20
.reg file that registers URL protocol "smb://" for SMB shared folders
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\smb]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\smb\shell]
[HKEY_CLASSES_ROOT\smb\shell\open]
[HKEY_CLASSES_ROOT\smb\shell\open\command]
@="powershell -WindowStyle Hidden -Command \"& { Invoke-Expression $(-join('cmd /c', [URI]::UnescapeDataString('start %1').Replace('smb://', '//').Replace('/', '\\'))) }\""
@mistificator
mistificator / readme.md
Last active August 10, 2024 18:02
How to run ESXDOS in Fuse emulator of ZX Spectrum

How to run ESXDOS in Fuse emulator of ZX Spectrum

1. Preparing disk image

1.1 Getting HdfMonkey, building and installing it

sudo apt install autoconf automake debhelper

git clone https://github.com/gasman/hdfmonkey.git

dpkg-source -b hdfmonkey

@mistificator
mistificator / async_start_gui_remote.sh
Last active December 7, 2022 10:05
command to asynchronously start GUI app on remote host inside XRDP session
#!/bin/sh
# command to asynchronously start GUI app on remote host inside XRDP session (batch command is part of "at" package)
ssh user@host "echo 'DISPLAY=:10 app_name' | at now"