2014-08-05更新
- 移動速度, 加速度センサーなどから歩数を計測.
- GPSやwifiの位置情報から移動距離を計測.
- 車など他の移動手段や消費カロリーなどの計測をするものもある.
- 万歩計は登録商標.
| require 'net/https' | |
| def restore_shorten_uri(uri) | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| http.use_ssl = uri.scheme == 'https' | |
| http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
| http.start do |h| | |
| res = h.head(uri.path) | |
| loc = res['Location'] | |
| URI.regexp =~ loc ? URI.parse(loc) : uri |
| #if DEBUG | |
| // http://www.zero4racer.com/blog/480 | |
| static void uncaughtExceptionHandler(NSException *exception) { | |
| NSLog(@"CRASH: %@", exception); | |
| NSLog(@"Stack Trace: %@", [exception callStackSymbols]); | |
| // Internal error reporting | |
| } | |
| #endif | |
| @implementation AppDelegate |
| // override | |
| - (instancetype)initWithBaseURL:(NSURL *)url | |
| { | |
| self = [super initWithBaseURL:url]; | |
| if (self) { | |
| self.requestSerializer = [AFJSONRequestSerializer serializer]; | |
| } | |
| return self; | |
| } |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
| // wait... | |
| [NSThread sleepForTimeInterval:1.0]; | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| // something you do ... | |
| }); | |
| }); |
| #define RELEASE_SAFELY(__POINTER) { [__POINTER release]; __POINTER = nil; } |
| // | |
| // MyURLProtocol.m | |
| // | |
| // Created by kitagawa on 2014/08/21. | |
| // Copyright (c) 2014年 kitagawa. All rights reserved. | |
| // | |
| #import "MyURLProtocol.h" | |
| static NSString *kCustomHeaderKey = @"API-Key"; |
iOS8での通知関連の変更について, WWDC2014, また以後公開されているリファレンスによる情報をまとめた.
iOS8から変わる点はおおきくわけると以下の3つになる.
| #!/bin/sh | |
| # According to https://developer.apple.com/LIBRARY/PRERELEASE/IOS/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html | |
| # And Referring to https://gist.github.com/lexrus/1984984 | |
| convert $1 -resize 180x180 [email protected] | |
| convert $1 -resize 120x120 [email protected] | |
| convert $1 -resize 152x152 [email protected] | |
| convert $1 -resize 76x76 [email protected] |