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
""" File: reveal.py | |
Add to ~/.lldbinit: | |
command script import ~/.lldb-scripts/reveal.py | |
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode? | |
A: In Xcode: | |
Add a Symbolic Breakpoint | |
Symbol: "UIApplicationMain" | |
Action: Debugger Command with value "reveal" |
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
/* Return a random integer number between low and high inclusive */ | |
int randomInt(int low, int high) | |
{ | |
return (arc4random() % (high-low+1)) + low; | |
} | |
/* Return a random BOOL value */ | |
BOOL randomBool() | |
{ | |
return (BOOL)randomInt(0, 1); |
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
// | |
// ModelUtil.h | |
// | |
// Copyright 2011 Chris Miles. All rights reserved. | |
// | |
// 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 |
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
let colorSpace = CGColorSpaceCreateDeviceRGB() | |
let componentCount : UInt = 4 | |
let components : [CGFloat] = [ | |
0, 0, 0, 0, | |
1.0, 1.0, 1.0, 1.0, | |
1.0, 1.0, 1.0, 1.0, | |
0, 0, 0, 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
// | |
// UIView+CMExtras.h | |
// | |
// Created by Chris Miles on 9/06/11. | |
// Copyright 2011 Chris Miles. | |
// | |
// 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 |
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 Program.h | |
// | |
// | |
// Created by BLE Sensor Tag. | |
// | |
// | |
#include <CoreBluetooth/CoreBluetooth.h> | |
#include "Sensors.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
@interface UIImageView (CMAsyncExtension) | |
- (void)asyncLoadImageFromURL:(NSURL *)imageURL; | |
@end | |
@implementation UIImageView (CMAsyncExtension) | |
- (void)asyncLoadImageFromURL:(NSURL *)imageURL | |
{ |
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+CMRandomised.h | |
// | |
// Copyright 2011 Chris Miles. All rights reserved. | |
// | |
// 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 |
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
/* | |
Example: | |
CGRect fillRect = CGRectMake(0.0, 0.0, 50.0, 100.0); | |
size_t locationCount = 2; | |
CGFloat locationList[] = {0.0, 1.0}; | |
CGFloat colorList[] = { | |
//red, green, blue, alpha | |
244.0/255.0, 207.0/255.0, 80.0/255.0, 1.0, | |
255.0/255.0, 161.0/255.0, 59.0/255.0, 1.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
@interface NSDate ( CMExtras ) | |
- (NSDate *)stripTimeComponent; | |
@end |
NewerOlder