Skip to content

Instantly share code, notes, and snippets.


Xiao Shen oaix

  • Shenzhen, Guangdong Province, China
View GitHub Profile

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at


Keep it simple, stupid. You ain't gonna need it.


Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](

wojteklu /
Last active Sep 27, 2022
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

dangkhoasdc / matlab2opencv.m
Created Dec 13, 2015
Save Matlab variable to yml/xml format in order to load data from OpenCV code.
View matlab2opencv.m
function [ ] = matlab2opencv( variable, fileName, flag )
%MATLAB2OPENCV Save `variable` to yml/xml file
% fileName: filename where the variable is stored
% flag: `a` for append, `w` for writing.
% Detailed explanation goes here
[rows cols] = size(variable);
% Beware of Matlab's linear indexing
variable = variable';
kevinhughes27 / Makefile
Created Apr 4, 2013
g++ Makefile for OpenCV Project
View Makefile
CC = g++
CFLAGS = -g -Wall
SRCS = HelloWorld.cpp
PROG = HelloWorld
OPENCV = `pkg-config opencv --cflags --libs`
$(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(LIBS)