Skip to content

Instantly share code, notes, and snippets.

@gvd
gvd / System Design.md
Created February 18, 2019 21:48 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@gvd
gvd / karma_transform_attribute.cpp
Last active January 6, 2018 19:04
Boost Karma on the fly conversion of attribute (Mercator to LatLon)
#include <iostream>
#include <boost/spirit/include/karma.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
struct LatLon {
double latitude;
double longitude;
};
struct Mercator {
@gvd
gvd / gist:4eda53bfd86117162e9be0e943d44e8e
Created January 5, 2018 21:09
Move a file to another directory once it is closed
inotifywait -e close_write input_dir/ --format %w%f | xargs -I {} mv {} output_dir/
@gvd
gvd / gist:d38e38d09f8838d5a9f9418305277f90
Created January 5, 2018 04:27
Git statistics for an author in a specific directory
git log --numstat --author="John Doe" --format=tformat: directory | grep ".*\.cpp$\|.*\.h$\|.*\.py$" | awk '{added += $1; removed += $2}END{printf "Added:\t\t%s\nRemoved:\t%s\nDelta:\t\t%s\nRatio:\t\t%s\n", added, removed, (added-removed), (added/removed) }' -