Skip to content

Instantly share code, notes, and snippets.

View alzix's full-sized avatar

Alexander Zilberkant alzix

View GitHub Profile
@alzix
alzix / my_nng_test.cpp
Created November 1, 2022 10:30
nng reconnection test
#include <gtest/gtest.h>
#include "nng/nng.h"
#include "nng/protocol/pair0/pair.h"
#include <iostream>
constexpr const char *k_url = "ipc://test_socket";
int SrvSockOpen(
@alzix
alzix / parser.py
Created October 14, 2017 22:38
python argparse - deprecating options
+class ActionStoreDeprecated(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ logger.warn('DEPRECATED: using %s', '|'.join(self.option_strings))
+ setattr(namespace, self.dest, values)
+
+
+class ActionAppendDeprecated(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ logger.warn('DEPRECATED: using %s', '|'.join(self.option_strings))
+ if not getattr(namespace, self.dest):