Skip to content

Instantly share code, notes, and snippets.

"\033[F" – move cursor to the beginning of the previous line
"\033[A" – move cursor up one line
ZMQ PUB SUB
@jstaursky
jstaursky / ZMQ_PROTO.org
Last active November 7, 2021 12:27
example zmq + protobuf

protobuf + zmq

C++ bit shifting and how it is reflected in memory.

The number

int16_t num =  0b1000_0000_0000_0001

stored as:

Little Endian.

                    LSB         MSB
;-----------------------------------------------------------
; LAYERS
(c-c++ :variables
c-c++-backend 'lsp-ccls
c-c++-adopt-subprojects t)
(lsp :variables
lsp-ui-peek-enable nil
lsp-use-lsp-ui nil
lsp-headerline-breadcrumb-enable nil
lsp-remap-xref-keybindings t
(use-package evil
:config
(setq evil-jmp-list '(
xref-goto-xref xref-quit-and-goto-xref
evil-scroll-page-down evil-scroll-page-up
jump-to-register))
(dolist (jumper evil-jmp-list)
(evil-add-command-properties jumper :jump t))
)
#include <iostream>
#include <memory>
using namespace std;
unique_ptr<int> factory(int i)
{
return unique_ptr<int>(new int(i));
}
#include <iostream>
class Exhibit;
class Season;
class Zoo {
public:
Zoo();
virtual ~Zoo();
#include <iostream>
#include <vector>
#include <cstdint>
#include <fmt/format.h>
using namespace std;
int main(int argc, char *argv[])
{
uint8_t a = 0b1111'0000;
@jstaursky
jstaursky / move-semantics.cpp
Last active July 13, 2021 00:55
move semantics tutorial program from https://www.youtube.com/watch?v=ehMg6zvXuMY "The Cherno"
#include <iostream>
#include <cstring>
class String
{
public:
String () = default;
String (const char* string)
{