Skip to content

Instantly share code, notes, and snippets.

@rikusouda
rikusouda / ObjcInCppVector.mm
Created June 16, 2018 12:43
In ARC, C++ std::vector has Objective-C instances
#import <Foundation/Foundation.h>
#include <string>
#include <vector>
@interface ObjcClass: NSObject
@property (nonatomic, readonly) NSString *name;
- (instancetype)initWithName:(NSString *)name;
- (void)speak;
@end
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active April 11, 2024 22:38
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}