Skip to content

Instantly share code, notes, and snippets.

View Wevah's full-sized avatar
💻
Computerin‘

Nate Weaver Wevah

💻
Computerin‘
View GitHub Profile
@Wevah
Wevah / gist:3335928
Created August 13, 2012 00:47
AEDebug redirect attempt
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DebugAppleEvents"]) {
NSError *error = nil;
NSFileManager *fm = [NSFileManager defaultManager];
NSURL *logsDir = [fm URLForDirectory:NSLibraryDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:nil];
logsDir = [logsDir URLByAppendingPathComponent:@"Logs"];
logsDir = [logsDir URLByAppendingPathComponent:@"Paparazzi!"];
if (![logsDir checkResourceIsReachableAndReturnError:&error]) {
if (![fm createDirectoryAtURL:logsDir withIntermediateDirectories:YES attributes:nil error:&error])
@Wevah
Wevah / NSApplicationSubclass.m
Created May 3, 2012 19:34
Prevent clicks in a popover from activating an LSUIElement app
- (void)sendEvent:(NSEvent *)event {
if ([event type] == NSAppKitDefined && ([event subtype] & NSApplicationActivatedEventType) && [[event window] respondsToSelector:@selector(_popover)])
return;
[super sendEvent:event];
}
@Wevah
Wevah / gist:2177811
Created March 24, 2012 03:08
Bigger tinychat
javascript:var a = document.getElementById('preload');a.style.marginLeft = '-200px';a.style.width = '1300px';a.style.height = '1200px';void(0);
@Wevah
Wevah / gist:1987687
Created March 6, 2012 17:41
NSPropertyListSerialization usage
NSString *errorString;
NSData *data = [NSPropertyListSerialization dataFromPropertyList:plist format:NSPropertyListXMLFormat_v1_0 errorDescription:&errorString];
if (!data)
NSLog(@"%@", errorString);