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
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
// Initialization code | |
self.pagingEnabled = YES; | |
self.contentSize = CGSizeMake(frame.size.width * 3, frame.size.height); | |
NSArray *master_color = @[[UIColor yellowColor], [UIColor magentaColor], [UIColor cyanColor]]; | |
for (int i = 0; i < 3; i++) { | |
UIView *master_backing = [[UIView alloc] initWithFrame:CGRectMake(frame.size.width*i, 0, frame.size.width, frame.size.height)]; |
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
2012-09-12 20:01:34.067 Business[844:907] page_9330062 | |
2012-09-12 20:01:34.068 Business[844:907] (null) - (null) | |
2012-09-12 20:01:34.069 Business[844:907] page_9328412 | |
2012-09-12 20:01:34.070 Business[844:907] (null) - (null) | |
2012-09-12 20:01:34.071 Business[844:907] page_9327512 | |
2012-09-12 20:01:34.072 Business[844:907] (null) - (null) | |
2012-09-12 20:01:34.073 Business[844:907] page_9324422 | |
2012-09-12 20:01:34.074 Business[844:907] (null) - (null) | |
2012-09-12 20:01:34.074 Business[844:907] page_9321342 | |
2012-09-12 20:01:34.075 Business[844:907] (null) - (null) |
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> | |
int main () { | |
system("kill -9 `ps -x | grep Xcode | grep \".app/Contents/MacOS/Xcode\" | awk '{print $1}'`"); | |
return 0; | |
} |
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
# iTunes | |
if isRunning("iTunes") then | |
tell application "iTunes" | |
if player state is playing then | |
set my_message to do shell script "RANGE=11; number=$RANDOM ; let \"number %= $RANGE\" ; echo `sed -n \"$number\"p ~/Documents/wordlist.txt`" | |
set nowPlaying to "/me is " & my_message & artist of current track & " - " & name of current track | |
end if | |
end tell | |
end if |
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 <AppKit/AppKit.h> | |
int main (int argc, const char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
if (argc == 2) { | |
NSString *folderPath = [[NSString stringWithFormat:@"%s",argv[1]] stringByExpandingTildeInPath]; | |
BOOL isFolder; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:folderPath isDirectory:&isFolder]) { |
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 <AppKit/AppKit.h> | |
int main (int argc, const char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
if (argc == 2) { | |
NSString *folderPath = [[NSString stringWithFormat:@"%s",argv[1]] stringByExpandingTildeInPath]; | |
BOOL isFolder; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:folderPath isDirectory:&isFolder]) { |
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
static inline NSData* SHA1HashOfFileAtPath(NSString *path) { | |
unsigned char hashBytes[CC_SHA1_DIGEST_LENGTH]; | |
NSData *fileData = [NSData dataWithContentsOfFile:path] | |
CC_SHA1([fileData bytes], [fileData length], hashBytes); | |
return [NSData dataWithBytes:hashBytes length:CC_SHA1_DIGEST_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
+ (NSArray *)devicesSupportingIPhoneOS { | |
NSMutableArray *devices = [NSMutableArray new]; | |
io_iterator_t iterator; | |
mach_port_t masterPort; | |
kern_return_t kr = IOMasterPort(MACH_PORT_NULL, &masterPort); | |
if (kr == kIOReturnSuccess && masterPort) { | |
CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOUSBDeviceClassName); | |
IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &iterator); | |
io_service_t usbDevice; | |
while (usbDevice = IOIteratorNext(iterator)) { |
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
/* | |
* OniTemplate.h | |
* OniLevelTool | |
* | |
* Created by Sam Marshall on 4/29/12. | |
* Copyright 2012 Sam Marshall. All rights reserved. | |
* | |
*/ | |
#include "headers.h" |
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 "SDMHaloMapLoader.h" | |
int main (int argc, const char * argv[]) { | |
struct HaloMap *map = ParseHaloMapFromFileWithPlugins("/Volumes/Data/Users/sam/Applications/Halo.app/Contents/Resources/GameData/Maps/beavercreek.map", "/Volumes/Data/Users/sam/Downloads/default (2)/"); | |
printf("beavercreek vehicles: %i\n",map->mapData->vehiCount); | |
return 0; | |
} |