Skip to content

Instantly share code, notes, and snippets.

View shannah's full-sized avatar

Steve Hannah shannah

View GitHub Profile
@Manouchehri
Manouchehri / About.txt
Created January 19, 2017 21:29 — forked from ctipper/About.txt
OSX app menu compatibility shim for JDK 9 EA releases
Abstract:
Hooks existing preferences/about/quit functionality from an existing Java app into handlers for the Mac OS X application menu.
Tailored to provide compatibility with the Java 9 EA releases so that the app may be built on other platforms. Note that there
is no compatibility with Java 8, though all that is required is to change java.awt.desktop -> com.apple.eawt in all handler methods
This work was inspired by an OSX compatibility layer provided by Apple that used a different API. This is an otherwise original
contribution and is a reimplementation using newer interface methods.
Usage:
@erikdoe
erikdoe / CCMKeychainHelper.m
Last active March 17, 2023 18:06
It took me way too long to wade through Keychain documentation and examples, but, finally, I got to a sane implementation of a basic Objective-C interface for managing internet passwords in Keychain. This is from my CCMenu project (http://ccmenu.org).
#import "CCMKeychainHelper.h"
@implementation CCMKeychainHelper
+ (BOOL)setPassword:(NSString *)password forURLString:(NSString *)aString error:(NSError **)errorPtr
{
return [self setPassword:password forURL:[NSURL URLWithString:aString] error:errorPtr];
}
+ (BOOL)setPassword:(NSString *)password forURL:(NSURL *)aURL error:(NSError **)errorPtr