Skip to content

Instantly share code, notes, and snippets.

View vladiant's full-sized avatar
🏠
Working from home

Vladislav Antonov vladiant

🏠
Working from home
View GitHub Profile
@vladiant
vladiant / main_14.cpp
Last active May 2, 2026 17:55
The Global API Injection Pattern
// https://www.elbeno.com/blog/?p=1831
// https://medium.com/@abhishek.kr121/variadic-templates-in-c-6955933f5781
#include <iostream>
// Initial code
// auto log() -> void { std::cout << std::endl; }
// template <typename T, typename... Args>
@vladiant
vladiant / ai_tutor_prompt.md
Created April 18, 2026 16:26
AI Exam Tutor: A Reusable Prompt for Any Certification

AI Exam Tutor — Certification Prep Prompt

Customise the three variables below, then paste into Claude.

EXAM_NAME = "[Your exam name — e.g. AWS Certified GenAI Developer Professional, CKA, GCP Professional Data Engineer, PMP]" MY_ROLE = "[Your background — e.g. Senior Software Engineer, DevOps Lead, Product Manager with 3 years cloud experience]" WEAK_AREAS = "[Known weak spots or leave blank — e.g. networking concepts, cost optimisation, IAM policies]"


You are my personal certification exam tutor helping me prepare for the {EXAM_NAME}.

@vladiant
vladiant / 10_std_apply_generic.cpp
Created November 4, 2025 19:23
C++ tuple iteration 2
#include <iostream>
#include <tuple>
// basic printing
template <typename TupleT, std::size_t... Is>
void printTupleImp(const TupleT& tp, std::index_sequence<Is...>) {
size_t index = 0;
auto printElem = [&index](const auto& x) {
if (index++ > 0)
std::cout << ", ";
@vladiant
vladiant / 1_tuple_iter.cpp
Created November 4, 2025 19:15
C++ tuple iteration 1
#include <iostream>
#include <tuple>
template <typename T>
void printElem(const T& x) {
std::cout << x << ',';
};
template <typename TupleT, std::size_t... Is>
void printTupleManual(const TupleT& tp) {
@vladiant
vladiant / ReadMe.md
Last active September 12, 2025 20:17
C++ contracts

Contracts

Main features

contract_assert replaces assert

  • Unlike assert, contract_assert is a proper keyword

Four build options: the evaluation semantics

  • ignore – do not check the assertion;
  • enforce — check the assertion; if the check fails, print a message and terminate (the default behaviour);
@vladiant
vladiant / Decision_Meeting.md
Last active February 8, 2026 19:55
Architecture Decision Records

Duration: 30–60 minutes (not more)

Agenda:

  • Quick context (2 min) — “We’re here to decide X. Everyone’s read the RFC”.
  • Address open questions (10–15 min) — Go through unresolved comments and open questions from the RFC
  • Discussion (15–30 min) — Debate the options, raise new concerns
  • Decision (5–10 min) — Make the call

Who should be there:

@vladiant
vladiant / crtp.cpp
Created April 8, 2025 18:10
C++26: variadic friends
// The base class
template<class Crtp, class MsgT>
class Receiver {
void receive(MsgT) {
static_cast<Crtp*>(this)->private_ += 1;
}
};
// The derived class
@vladiant
vladiant / template_metaprogramming_helpers.cpp
Created April 8, 2025 18:00
Tiny C++ template metaprogramming helpers
// https://vawale.github.io/posts/template_metaprogramming_helpers/
template<typename... Args>
consteval auto count() {
return sizeof...(Args);
}
template<template <typename T> typename Predicate, typename... Args>
consteval auto count_if() -> size_t {
return (0 + ... + Predicate<Args>{}());