Skip to content

Instantly share code, notes, and snippets.

View lilyball's full-sized avatar

Lily Ballard lilyball

View GitHub Profile
Filesystem Size Used Avail Capacity Mounted on
/dev/disk3s2 238Gi 172Gi 66Gi 73% /
devfs 128Ki 128Ki 0Bi 100% /dev
/dev/disk0s3 466Gi 366Gi 99Gi 79% /Volumes/Radagast
/dev/disk2s2 931Gi 714Gi 217Gi 77% /Volumes/Backup
/dev/disk1s3 16Gi 5.6Gi 10Gi 35% /Volumes/SMEAGOL
/dev/disk1s4 61Gi 48Gi 13Gi 79% /Volumes/Windows
map -hosts 0Bi 0Bi 0Bi 100% /net
map auto_home 0Bi 0Bi 0Bi 100% /home
/dev/disk4s2 4.0Ti 1.6Ti 2.4Ti 41% /Volumes/Aragorn
func Match(pattern, name string) (matched bool, err os.Error) {
Pattern:
for len(pattern) > 0 {
var star bool
var chunk string
star, chunk, pattern = scanChunk(pattern)
if star && chunk == "" {
// Trailing * matches rest of string unless it has a /.
return strings.Index(name, "/") < 0, nil
}
NSString *path = [[NSBundle mainBundle] pathForResource:@"Root" ofType:@"plist" inDirectory:@"Settings.bundle"];
NSDictionary *rootDict = [NSDictionary dictionaryWithContentsOfFile:path];
NSArray *prefSpecifiers = [rootDict objectForKey:@"PreferenceSpecifiers"];
NSMutableDictionary *defaults = [NSMutableDictionary dictionaryWithCapacity:[prefSpecifiers count]];
for (NSDictionary *item in prefSpecifiers) {
NSString *key = [item objectForKey:@"Key"];
NSString *value = [item objectForKey:@"DefaultValue"];
[defaults setObject:value forKey:key];
}
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
#import <Foundation/Foundation.h>
@interface NSRunLoop (NSRunLoop_S9Blocks)
- (void)runBlock:(void (^)(void))block;
@end
@interface NSArray (BinarySearch)
- (NSUInteger)indexOfObjectUsingBinarySearch:(id)obj;
@end
@implementation NSArray (BinarySearch)
// performs a binary search in the array, returning the index of the found object or NSNotFound
// this assumes the array is in sorted order according to the compare: selector
- (NSUInteger)indexOfObjectUsingBinarySearch:(id)obj {
NSRange range = NSMakeRange(0, [self count]);
while (range.length > 0) {
Wed Jul 21 22:02:50 Mithrandir sandboxd[2949] <Notice>: transporter(2948) deny file-write* /Applications/.dat0b84.002
Wed Jul 21 22:02:50 Mithrandir sandboxd[2949] <Notice>: transporter(2948) deny file-write* /Applications/.dat0b84.003
Wed Jul 21 22:02:50 Mithrandir kernel[0] <Debug>: launchd[2948] Builtin profile: container (sandbox)
@lilyball
lilyball / objc+blocks.h
Created August 3, 2010 03:01
Method to iterate the properties on an object
/*
* objc+blocks.h
*
* Created by Kevin Ballard on 1/13/10.
*
*/
#import <objc/runtime.h>
enum {
typedef long my_dispatch_once_t;
typedef void (^my_dispatch_block_t)(void);
void my_dispatch_once(my_dispatch_once_t *predicate, my_dispatch_block_t block);
#import <UIKit/UIKit.h>
@interface ScaleTestViewController : UIViewController
@property (nonatomic, retain) IBOutlet UIView *scaleView;
@end
@lilyball
lilyball / gist:571408
Created September 9, 2010 05:10
Patch for Simple Comic
diff --git a/Session/TSSTPageView.m b/Session/TSSTPageView.m
index b4a5f55..3c994f9 100644
--- a/Session/TSSTPageView.m
+++ b/Session/TSSTPageView.m
@@ -136,7 +136,7 @@
firstPageImage, @"pageImage",
[testImageRep valueForProperty: NSImageLoopCount], @"loopCount",nil];
frameDuration = [[testImageRep valueForProperty: NSImageCurrentFrameDuration] floatValue];
- frameDuration = frameDuration > 0.01 ? frameDuration : 0.01;
+ frameDuration = frameDuration >= 0.01 ? frameDuration : 0.1;