Skip to content

Instantly share code, notes, and snippets.

View indiosmo's full-sized avatar

Luiz Siqueira indiosmo

  • São Paulo, SP - Brazil
View GitHub Profile
@mbinna
mbinna / effective_modern_cmake.md
Last active May 6, 2024 17:19
Effective Modern CMake

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](https://www.amazon.de/Large-Scale-Soft

@clemensv
clemensv / gist:6554605
Last active April 6, 2018 03:16
using Task.WhenAny to drive a pump of multiple async operations in the same context (such as an I/O pump)
/*
Example use (from an email I sent)
I’m using WhenAny to either register for a callback on any of the pending operations and to use
the IO thread that comes up with their respective completion or to execute handling of completed
work on the current thread (‘borrowing’ the IO thread).
So if I read from a socket and from a queue, first both ops hang. Queue read completes and I get
called back on an IO thread which continues the await. I process that completion in the loop.
Meanwhile the socket read completes. That IO thread pops up and just registers the fact that it’s
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD