Skip to content

Instantly share code, notes, and snippets.

View gcox's full-sized avatar

George Cox gcox

View GitHub Profile
@gcox
gcox / TWVersion.h
Last active August 29, 2015 14:01
A class for getting Mac OS system version, bundle versions, and comparison of versions.
The MIT License (MIT)
Copyright (c) 2014 Tundaware LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@gcox
gcox / gist:9284624
Last active August 29, 2015 13:56
NSFileManager category for getting a list of all applications
#import <Foundation/Foundation.h>
@interface NSFileManager (ApplicationList)
-(NSArray *)applicationList;
@end
@gcox
gcox / TWNSArrayController.h
Last active December 20, 2015 22:29
NSArrayController with throttled rearrangement When frequently changing objects monitored by an NSArrayController with auto rearrangement enabled, you can quickly run into an annoying performance issue caused by the array controller rearranging with unnecessary frequency. This subclass allows you to temporarily suspend rearrangement and/or throt…
@interface TWNSArrayController : NSArrayController
@property (nonatomic) BOOL throttleRearrangement;
@property (nonatomic) CGFloat rearrangementThrottleInterval;
-(void)suspendRearrangement;
-(void)resumeRearrangement;
@end
@gcox
gcox / gist:1961202
Created March 2, 2012 20:46
Thread-safe singleton pattern using dispatch_once
@interface Something : NSObject
+(Something *)somethingSingleton;
@end
@implementation Something
+(Something *)somethingSingleton {