Skip to content

Instantly share code, notes, and snippets.

View westfly's full-sized avatar

Rayan westfly

  • BeiJing,China
View GitHub Profile
@westfly
westfly / product.cpp
Created May 25, 2021 02:40 — forked from Alexhuszagh/product.cpp
Cartesian Product Implementation in C++
// :copyright: (c) 2017 Alex Huszagh.
// :license: MIT.
/**
* Cartesian product algorithm.
*
* Lazily calculates the cartesian product from a container of containers,
* of either linear (array, vector, set, unordered_set) or associative
* (map, unordered_map, multimap, unordered_multimap) containers.
*
* The code can be used as follows:
@westfly
westfly / to_tuple.cpp
Created February 5, 2021 13:50 — forked from talybin/to_tuple.cpp
Struct to tuple conversion (CppCon 2019, Kris Jusiak)
#include <tuple>
#include <type_traits>
template <class T, class... TArgs>
decltype(void(T{std::declval<TArgs>()...}), std::true_type{})
test_is_braces_constructible(int);
template <class, class...>
std::false_type
test_is_braces_constructible(...);
@westfly
westfly / tmux-cheatsheet.markdown
Created October 31, 2019 01:08 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: