Skip to content

Instantly share code, notes, and snippets.

View leha-bot's full-sized avatar
🐝
"Then" (c). I may be slow to respond, sorry about this.

Alex leha-bot

🐝
"Then" (c). I may be slow to respond, sorry about this.
View GitHub Profile
@alkuzad
alkuzad / destroy_and_GECK_docker_desktop.ps1
Last active March 16, 2025 23:08
Restart script to restart WSL, DockerDesktop and LxssManager. This script should unblock blocked wsl/docker-desktop.
# MIT License
# Copyright (c) 2023 Dawid Goslawski
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@tilkinsc
tilkinsc / main.cpp
Last active February 19, 2025 03:24
WGL Full Demo
/**
*
* MIT License
*
* Copyright (c) 2017-2022 Cody Tilkins
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rounk-ctrl
rounk-ctrl / Dark.md
Last active March 26, 2025 07:52
Win32 Dark Mode

Dark Mode APIs.

API Signatures.

ShouldAppsUseDarkMode()

Checks whether system is using dark mode or not.
Signature:

using fnShouldAppsUseDarkMode = bool (WINAPI*)(); // ordinal 132

AllowDarkModeForWindow(In HWND hWnd, In bool allow)

@oquenchil
oquenchil / cc_static_library.bzl
Created October 6, 2021 12:55
Example cc_static_library.bzl
"""Provides a rule that outputs a monolithic static library."""
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
TOOLS_CPP_REPO = "@bazel_tools"
def _cc_static_library_impl(ctx):
output_lib = ctx.actions.declare_file("{}.a".format(ctx.attr.name))
output_flags = ctx.actions.declare_file("{}.link".format(ctx.attr.name))
@oofnikj
oofnikj / answerfile
Last active April 19, 2025 11:40
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@ppoffice
ppoffice / README.md
Last active April 16, 2025 04:30
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@Nekrolm
Nekrolm / cpp14_traits_3.md
Last active August 25, 2020 21:45
cpp14_17_traits_part3

C++14/17 type_traits Часть 3.

В предыдущей серии мы изобретали нечто, называемое XXX_traits, где под XXX скрывается какой-то концепт. А сам трейт описывает, какие операции доступны для типов, реализующих данный концепт. И все взаимодействие с шаблонными параметрами происходило с помощью вспомогательной структуры.

template <class T, class S>
auto accumulate(const std::vector<T>& arr, S&& op) 
    -> RESULT<T>::REQUIRES<SummatorTraits<S>::value> {
    using STraits = SummatorTraits<S>;
@LFriede
LFriede / a_install-old-qt-versions.md
Last active April 8, 2025 14:29
How to trick "Qt Maintenance Tool" to install old versions

How to trick "Qt Maintenance Tool" to install old versions

tl;dr

Use a software like mitmproxy to modify the (https)-request to iapi.qt.io/api/v2/repositories so it's response lists the old Qt directorys that are still on the servers.

If you never used mitmproxy before here is the guide that shows you how it's done.

/*
c++: 17
deps:
- org.sw.demo.jtv.pqxx
- org.sw.demo.apolukhin.magic_get
*/
#include <boost/pfr/precise/core.hpp>
#include <pqxx/pqxx>
@Nekrolm
Nekrolm / cpp14_traits_2.md
Last active August 25, 2020 21:45
cpp14_traits_part2

C++14/17 type_traits Часть 2.

В предыдущей серии мы пытались сделать нечто, напоминающее проверку концепции C++20 средствами C++14/17.

У нас была функция sum, от типов аргументов которой мы требовали применимости операции +. И выглядело в конечном итоге это так:

template<typename T>
auto sum(T a, T b) -&gt; RESULT::REQUIRES&gt; {