Skip to content

Instantly share code, notes, and snippets.

View xakod's full-sized avatar

Anton xakod

  • Cyberprotect
  • Moscow
View GitHub Profile
@xakod
xakod / VS2013winxp.cmake
Created March 11, 2025 18:33
Visual Studio 2013 cmake toolchain file with win xp support
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 7.1)
set(MSVC_TOOLSET_VERSION 120)
set(WIN_120XP_SDK "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A")
set(MSVC_120_DIR "C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC")
find_program (MSVC_COMPILER cl
PATHS ${MSVC_120_DIR}/bin/amd64 NO_DEFAULT_PATH REQUIRED)
@xakod
xakod / FindSIGCXX.cmake
Created March 29, 2023 21:05
Cmake libsigc++ find script
# - Try to find libsigc++ include dirs and libraries
#
# Usage of this module as follows:
#
# find_package(SIGCXX)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# SIGCXX_ROOT_DIR Set this variable to the root installation of
@xakod
xakod / FindDBusCXX.cmake
Last active March 28, 2023 11:32
Cmake libdbus-c++-1
# - Try to find libdbus-c++-1 include dirs and libraries
#
# Usage of this module as follows:
#
# find_package(DBusCXX)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# DBusCXX_ROOT_DIR Set this variable to the root installation of
@xakod
xakod / type_info_it.cpp
Created August 1, 2021 15:41
Compile time type info iteration
#include <array>
#include <iostream>
#include <variant>
static_assert(__GNUC__, "Unsupported compiler");
using BYTE = uint8_t;
using WORD = uint16_t;
using DWORD = uint32_t;
using INT32 = int32_t;
@xakod
xakod / variadic_traits.cpp
Created July 27, 2021 14:20
simple variadic type_traits
#include <iostream>
#include <tuple>
#include <type_traits>
#include <utility>
template <bool... Bs> using bool_sequence = std::integer_sequence<bool, Bs...>;
template <bool... Bs>
using bool_and =
std::is_same<bool_sequence<Bs...>, bool_sequence<(Bs || true)...>>;
@xakod
xakod / zeromqrd.cpp
Created June 3, 2021 15:11
zeromq ROUTER-DEALER example
#include <chrono>
#include <functional>
#include <iostream>
#include <memory>
#include <thread>
#include <vector>
#include <zmq.hpp>
#define within(num) (int)((float)((num)*random()) / (RAND_MAX + 1.0))
// This is our client task class.