Skip to content

Instantly share code, notes, and snippets.

View Jihadist's full-sized avatar

Anton Jihadist

  • Cyberprotect
  • Moscow
View GitHub Profile
@Jihadist
Jihadist / 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
@Jihadist
Jihadist / 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
@Jihadist
Jihadist / 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;
@Jihadist
Jihadist / 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)...>>;
@Jihadist
Jihadist / 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.