This file contains hidden or 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
- (void)update | |
{ | |
// check interval and update text | |
if ( _running ) { | |
// do the update | |
NSTimeInterval tmpInterval = [self.date timeIntervalSinceNow]; | |
int tmpMins = tmpInterval/60; | |
int tmpSecs = tmpInterval-(tmpMins*60); |
This file contains hidden or 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
typedef NS_ENUM(NSInteger, UIScrollViewScrollDirection) { | |
UIScrollViewScrollDirectionDown = -1, | |
UIScrollViewScrollDirectionNone = 0, | |
UIScrollViewScrollDirectionUp = 1, | |
}; | |
@interface FRJViewController () | |
@property (nonatomic) UIScrollViewScrollDirection scrollDirection; |
This file contains hidden or 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
/* via http://helios.io | |
Use the following commands to install Helios, create a new app, and start running the app locally at http://localhost:5000 | |
$ gem install helios | |
$ helios new app | |
$ cd app && helios start | |
*/ | |
Enki-II:utility-sportsapp-ios ian$ sudo gem install helios | |
Password: |
This file contains hidden or 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
- (void)setFramesWithFirstFrame:(NSString *)fileName; | |
{ | |
// DLog(@"firstFrame: %@",fileName); | |
[self setImage:[UIImage imageNamed:fileName]]; | |
// split the `fileName` into a base and number. then incrememnt the number until imageNamed returns nil. | |
// check for numbers in the filename | |
NSRange pngRange = [fileName rangeOfString:@".png"]; | |
NSRange numberRange; |
This file contains hidden or 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
// from: current location | |
float fLat = (currentLocation.coordinate.latitude / 180.0) * M_PI; | |
float fLng = (currentLocation.coordinate.longitude / 180.0) * M_PI; | |
// to: waypoint location | |
float tLat = (waypoint.locationLat / 180.0) * M_PI; | |
float tLng = (waypoint.locationLon / 180.0) * M_PI; | |
// calculate it! | |
float locationHeading = atan2(sin(tLng-fLng)*cos(tLat), cos(fLat)*sin(tLat)-sin(fLat)*cos(tLat)*cos(tLng-fLng)); |
This file contains hidden or 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
Enoch:~ ian$ iostat -n9 -w1 | |
disk0 disk1 disk2 disk3 disk4 cpu load average | |
KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us sy id 1m 5m 15m | |
26.76 4 0.10 1722.13 0 0.00 1750.15 0 0.00 15.35 0 0.00 319.46 0 0.00 1 1 97 0.86 1.11 1.24 | |
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 597.33 6 3.49 4 4 92 0.86 1.11 1.24 | |
8.00 7 0.05 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 718.29 7 4.90 7 7 86 0.86 1.11 1.24 | |
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 2470.40 5 12.04 14 8 78 0.86 1.11 1.24 | |
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 1480.00 2 2.89 4 4 92 0.86 1.11 1.24 | |
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 808.57 7 5.52 8 7 85 0.79 1.09 1.23 | |
0.00 0 0.00 0.00 0 0.00 |
This file contains hidden or 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
// | |
// RikerIpsum.h | |
// | |
// Based on http://www.rikeripsum.com | |
// Created by @frijole on 3/19/13. | |
// | |
#import <Foundation/Foundation.h> | |
@interface RikerIpsum : NSObject |
This file contains hidden or 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
// NEW RANDOM ACTION | |
NSString *lineSources = [[NSBundle mainBundle] pathForResource:@"quotes" ofType:@"plist"]; | |
NSDictionary *lines = [[NSDictionary alloc] initWithContentsOfFile:lineSources]; | |
NSMutableArray *line1Strings = [lines valueForKey:@"line1"]; | |
NSMutableArray *line2Strings = [lines valueForKey:@"line2"]; | |
NSMutableArray *line3Strings = [lines valueForKey:@"line3"]; | |
NSMutableArray *line4Strings = [lines valueForKey:@"line4"]; | |
NSMutableArray *line5Strings = [lines valueForKey:@"line5"]; |
NewerOlder