This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSString *s1 = @"foo"; | |
NSString *s2 = @"foo"; | |
NSString *s3 = [[NSString alloc] initWithString:@"foo"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char **argv) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSString *json = @"DUMMY({parameters:{code:\"60246\", language:\"en\", country:\"en\"}, result:{\"...JSON...});"; | |
NSUInteger rangeStart = [json rangeOfString:@"result:"].location; | |
NSUInteger lastBrace = [json rangeOfString:@"}" options:NSBackwardsSearch].location; | |
NSUInteger jsonStart = rangeStart + [@"result:" length]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char **argv) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSString *json = @"DUMMY({parameters:{code:\"60246\", language:\"en\", country:\"en\"}, result:{\"...JSON...});"; | |
NSUInteger rangeStart = [json rangeOfString:@"result:"].location; | |
NSString *justJson = [json substringFromIndex:rangeStart + [@"range:" length]]; | |
NSUInteger lastBrace = [justJson rangeOfString:@"}" options:NSBackwardsSearch].location; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct base { | |
int foo; | |
}; | |
struct derived { | |
int foo; | |
char *bar; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A bash completion script for Fabric targets | |
# Author: Michael Dippery <[email protected]> | |
_complete_fabric() { | |
COMPREPLY=() | |
if [ -e ./fabfile.py ]; then | |
local targets=$(fab -l | sed '1,2d' | awk '{print $1}') | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( $(compgen -W "${targets}" -- ${cur}) ) | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Book : NSObject | |
{ | |
NSMutableDictionary *data; | |
} | |
@property (retain) NSString *title; | |
@property (retain) NSString *author; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) | |
{ | |
int i; | |
fprintf(stderr, | |
" FAIL WHALE! \n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSObject (NSNullCheck) | |
- (BOOL)isNull; | |
@end | |
@implementation NSObject (NSNullCheck) | |
- (BOOL)isNull { return NO; } | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Michael Dippery on 1/12/2011. | |
// Copyright 2011 Michael Dippery. All rights reserved. | |
// | |
#import "FileTailer.h" | |
@implementation FileTailer | |
- (id)initWithPath:(NSString *)path refreshPeriod:(NSTimeInterval)aRefresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2011 Michael Dippery <[email protected]> | |
* | |
* 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: | |
* |
OlderNewer