Skip to content

Instantly share code, notes, and snippets.

@tempelmann
tempelmann / AppDelegate_NSAlert.m
Last active March 8, 2020 14:15
A solution to the question "How can I make the cancel button react to both the Return the the Esc keys?"
// A solution to the question "How can I make the cancel button react to both the Return the the Esc keys?"
//
// See https://stackoverflow.com/a/60570407/43615
#import "AppDelegate.h"
@interface AlertEscHandler : NSView
@end
@implementation AlertEscHandler
@tempelmann
tempelmann / regex with normalization variations.c
Created April 28, 2019 16:44
Search unicode (UTF-8) text in any normalization form, case-insensitive
//
// Created by Thomas Tempelmann on 28.04.19.
// See also: https://stackoverflow.com/q/55884928/43615
//
// This code relies on string functions only available on macOS, sorry.
//
#include <Foundation/Foundation.h>
#include <string.h>
#include <stdlib.h>
@tempelmann
tempelmann / console output
Last active April 14, 2019 18:57
Weird NSUserDefaults/CFPreferences behavior. See https://twitter.com/tempelorg/status/1117388426221846529
i: 165
r0: 165
r1: (null)
r2: 165
r3: (null)
r4: 175
@tempelmann
tempelmann / # python - 2018-06-29_19-50-51.txt
Created August 17, 2018 11:31
python on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for python on macOS 10.12.6
Build date: 2018-06-29 19:50:51