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
(************************************************************************************ | |
Copies the derived data directory for the current Xcode4 project or workspace to the clipboard | |
The copied path is in POSIX form suitable for pasting into a Terminal instance. | |
Created 03/04/2011 by Ben Dolman | |
This code is in the public domain | |
************************************************************************************) | |
set derivedDataDir to (path to current user folder as string) & "Library:Developer:Xcode:DerivedData:" | |
tell application "Xcode" |
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
NSData *bom = nil; | |
NSStringEncoding encoding = ...; | |
NSData *a = [@"a" dataUsingEncoding:encoding]; | |
NSData *aa = [@"aa" dataUsingEncoding:encoding]; | |
if ([a length] * 2 != [aa length]) { | |
NSUInteger characterLength = [aa length] - [a length]; | |
bom = [a subdataWithRange:NSMakeRange(0, [a length]-characterLength)]; | |
} |
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
- All Creatures Great & Small | |
- Alphas | |
- Arrested Development | |
+ Avatar: the Last Airbender | |
- Babylon 5 | |
+ Battlestar Galactica | |
- Big Bang Theory | |
+ Caprica | |
+ Castle | |
- Continuum |
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
// | |
// main.m | |
// Tag Cleaner | |
// | |
// Created by Dave DeLong on 11/17/12. | |
// Copyright (c) 2012 Dave DeLong. All rights reserved. | |
// | |
// requires https://github.com/evernote/evernote-sdk-mac |
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
xlog = log --graph --pretty=format:\"%C(yellow)%h%Creset %ad %s%C(cyan)%d%Creset %C(green)[%an]%Creset\" --date=short |
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
__block void(^block)(int) = ^(int i) { | |
printf("%d", i); | |
if (i > 0) { | |
block(i-1); | |
} else { | |
block = nil; | |
} | |
}; | |
block(9); |
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
@interface DDControlledView : NSView | |
@property (weak) IBOutlet NSViewController *viewController; | |
@end | |
@implementation DDControlledView | |
- (void)setNextResponder:(NSResponder *)aResponder { | |
NSViewController *controller = self.viewController; |
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
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSString *str = @"Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding."; | |
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding]; | |
char table[] = { | |
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', | |
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', |
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
@interface DDDelegateProxy : NSProxy | |
+ (id)proxyForDelegate:(id)delegate conformingToProtocol:(Protocol *)protocol; | |
@property (weak, readonly) id delegate; | |
@property (strong, readonly) Protocol *protocol; | |
/*! | |
* Set a default return value for a method on the delegate's protocol. | |
* \param value This must be a block that returns the default value. Bad Things will happen if it's not. |
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
mdfind "kMDItemAppStoreIsAppleSigned !=1 && kMDItemContentType = \"com.apple.application-bundle\" && kMDItemCFBundleIdentifier != "com.apple.*"" -onlyin /Applications |
OlderNewer