Skip to content

Instantly share code, notes, and snippets.

@DevSecTim
DevSecTim / AutoHotkey.ahk
Created October 29, 2013 17:05
Example AutoHotkey script that essentially makes Windows act like OS X Lion (significantly, it inverts the scroll direction of the trackpad)
; Increase maximum hotkeys (needed for scrolling to work)
#HotkeyInterval 250
; Alt-3 for Hash/Pound
!3::
Send {#}
Return
; Invert scrolling direction (OS X Lion behaviour)
WheelUp::
@DevSecTim
DevSecTim / DynamicLibrary.cpp
Last active December 30, 2015 09:08
This gist demonstrates how to wrap the dynamic loading of DLLs/SOs using some C++11 techniques, including variadic templates and std::function. To load the library you just call lib.load() and then lib.callFunction<return_type>("FuncName", param1, param2 ...).
#include <cstdio>
#include <string>
#include <sstream>
#include <stdexcept>
#ifdef _MSC_VER
#include <Windows.h>
#include <direct.h>
#else
#include <dlfcn.h>
@DevSecTim
DevSecTim / Pipeline.h
Created June 3, 2014 09:52
A simple Pipeline template example, with Sequence and Filter implementations - Sequence simply chains together functions to be executed sequentially and Filter can be used to erase the contents of a standard container based on staged rule functions.
// Pipeline base class
template <typename T, typename F>
class Pipeline
{
public:
typedef std::function<F> Func;
Pipeline() = default;