Skip to content

Instantly share code, notes, and snippets.

@yizhang82
yizhang82 / rw_spin_lock.h
Created October 7, 2017 20:41
portable lock-free reader/writer lock for C++
class rw_spin_lock
{
public:
rw_spin_lock()
{
_readers = 0;
}
public:
void acquire_reader()
@g2p
g2p / layouts.py
Last active January 4, 2016 08:49
Detect keyboard layouts (azerty, qwertz, others) using SDL2
#clone https://bitbucket.org/marcusva/py-sdl2
"""
Distinguish azerty/qwerty/qwertz
After experimenting, must SDL_INIT_VIDEO and use
SDL_GetKeyFromScancode or SDL_GetScancodeFromKey
The mapping is cached by SDL2;
enable the event loop or use SDL_Quit to detect again.
@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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: