Skip to content

Instantly share code, notes, and snippets.

@marchelbling
marchelbling / README.md
Last active April 1, 2022 06:35
C++ json writer

why?

This code implements a naive JSON writer in C++ complying with RFC 4627. I wrote this as I believe it is a very good example of a real life problem involving lots of C++ constructs. This sample only supports writing JSON and does not support heterogenous ‘object’ serialization and extension are left as an exercice. See Writing json in C++ for some details.

what?

  • json_stream: a std::ofstream wrapper fulfilling RFC 4627 constraints;
  • utf8_json: some code to decode/“json encode” std::string UTF-8 buffers
  • json_test.cpp: a very simple program testing the code
@marchelbling
marchelbling / 100-local-citus.sql
Last active July 5, 2023 15:47
Local Citus cluster setup — bis
-- user:
CREATE ROLE citus WITH NOSUPERUSER LOGIN IN ROLE pg_monitor;
-- database:
ALTER DATABASE citus SET citus.shard_replication_factor = 1;
ALTER DATABASE citus OWNER TO citus;
-- extensions:
CREATE EXTENSION IF NOT EXISTS "hll";
CREATE EXTENSION IF NOT EXISTS "topn";