Skip to content

Instantly share code, notes, and snippets.

View ColinKennedy's full-sized avatar
🏠
Working from home

Colin Kennedy ColinKennedy

🏠
Working from home
View GitHub Profile
@ColinKennedy
ColinKennedy / README.md
Created April 25, 2024 06:48 — forked from runiq/README.md
Neovim throttle & debounce

What are these?

Functions that allow you to call a function not more than once in a given timeframe.

Throttling on the leading edge

This can be illustrated with timing diagrams. In the following diagrams, f designates call to the throttled function, t is the period where the timer is running, and x shows you the actual execution point of the throttled function.

f 1  2  3  4  5  6
@ColinKennedy
ColinKennedy / converter.h
Created September 22, 2022 06:07 — forked from wayhoww/converter.h
Boost.Python: Automatical Type Conversion
/**
* For Boost.Python
*
* Automatically convert between Python list, dict, tuple and C++ STL std::vector, std::map, std::tuple, respectively.
* --------------------------------------
* 自动转换 Python 和 STL 的几个常用数据类型。
*
* I am familiar with neither metaprogramming nor Boost.Python. This header works but I believe
* there are better ways (or even existing libraries) to do these conversions. Please comment at
* this page to help me improve it.