Skip to content

Instantly share code, notes, and snippets.

View alebastr's full-sized avatar

Aleksei Bavshin alebastr

  • Sunnyvale, CA
  • 15:32 (UTC -07:00)
View GitHub Profile
@alebastr
alebastr / generator.cpp
Created January 6, 2024 04:25
`XKB_KEYSYM_NO_FLAGS` vs `XKB_KEYSYM_CASE_INSENSITIVE`
// const char *key_names [] = {
// `sed -En 's/^#.*XKB_KEY_(\w*).*/"\1",/p' /usr/include/xkbcommon/xkbcommon-keysyms.h |sort -u`
// };
//
// g++ $(pkg-config --libs --cflags xkbcommon) generator.cpp
#include <cstdio>
#include <cstdlib>
#include <xkbcommon/xkbcommon.h>
@alebastr
alebastr / Makefile
Last active February 10, 2021 21:58
wl-output.cpp
CXXFLAGS += -std=c++17
CXXFLAGS += -Wall -Wextra -pedantic
CXXFLAGS += $(shell pkg-config --cflags wayland-client)
CFLAGS += $(shell pkg-config --cflags wayland-client)
LDFLAGS += $(shell pkg-config --libs wayland-client)
SCANNER = $(shell pkg-config --variable=wayland_scanner wayland-scanner)
PROTOCOLS_DIR = $(shell pkg-config --variable=pkgdatadir wayland-protocols)
XDG_OUTPUT_PROTO = $(PROTOCOLS_DIR)/unstable/xdg-output/xdg-output-unstable-v1.xml
/*
* CXXFLAGS += -std=c++17
* CXXFLAGS += $(shell pkg-config --cflags catch2 fmt glibmm-2.4)
* LDFLAGS += $(shell pkg-config --libs catch2 fmt glibmm-2.4)
*/
#define CATCH_CONFIG_MAIN
#define FMT_USE_INTERNAL
#include <catch2/catch.hpp>
#include <fmt/format.h>
@alebastr
alebastr / json.cpp
Created January 2, 2020 21:43
Boost::Spirit toy JSON Parser
#include <iostream>
#include <iomanip>
#include <map>
#include <vector>
#include <string>
//#define BOOST_SPIRIT_DEBUG
/* Required */
#define BOOST_SPIRIT_USE_PHOENIX_V3