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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-000000-00', 'auto'); | |
ga('send', 'pageview'); | |
</script> |
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
$(document).on 'page:before-change' , -> console.log 'page:before-change' | |
$(document).on 'page:fetch' , -> console.log 'page:fetch' | |
$(document).on 'page:receive' , -> console.log 'page:receive' | |
$(document).on 'page:change' , -> console.log 'page:change' | |
$(document).on 'page:update' , -> console.log 'page:update' | |
$(document).on 'page:load' , -> console.log 'page:load' | |
$(document).on 'ready page:load' , -> console.log 'ready and load' | |
$(document).ready -> console.log '$(document).ready in assets' | |
$(window).on 'load' , -> console.log '$(window).load in assets' |
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
(1000万 - 300万) * 0.8 = 56万 |
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 MINIMUM_MAP_SPAN = MKCoordinateSpanMake(0.002, 0.002) | |
var topLeftCoord = CLLocationCoordinate2D(latitude: -90, longitude: 180) | |
var bottomRightCoord = CLLocationCoordinate2D(latitude: 90, longitude: -180) | |
// 2点間の計算を行う。 | |
// 現在地 | |
topLeftCoord.longitude = fmin(topLeftCoord.longitude, localCoordinate.longitude) | |
topLeftCoord.latitude = fmax(topLeftCoord.latitude, localCoordinate.latitude) |
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 daddr = NSString(format: "%f,%f", latitude, longitude) | |
let urlString = "http://maps.apple.com/?daddr=\(daddr)&dirflg=d" | |
let encodedUrl = urlString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! | |
let url = NSURL(string: encodedUrl)! | |
UIApplication.sharedApplication().openURL(url) |
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 a:Observable<Int> = Observable.create { observable in | |
NSOperationQueue().addOperationWithBlock({ () -> Void in | |
sleep(5) | |
observable.onNext(1) | |
observable.onCompleted() | |
}) | |
return NopDisposable.instance | |
} | |
let b:Observable<Int> = Observable.create { observable in |
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
var value:Int |
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 RxSwift | |
class NotificationCenter { | |
static let observable = PublishSubject<String>() | |
} |
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
- (void) loadStringsFile:(NSString*) file | |
{ | |
// Load default localization dictionary | |
NSString* path = [[CCFileUtils sharedFileUtils] fullPathForFilename:file]; | |
// Load strings file | |
NSDictionary* ser = [NSDictionary dictionaryWithContentsOfFile:path]; | |
// Check that format of file is correct | |
NSAssert([[ser objectForKey:@"fileType"] isEqualToString:@"SpriteBuilderTranslations"], @"Invalid file format for SpriteBuilder localizations"); |
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
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { | |
// GoogleAnalytice | |
GoogleAnalytics.setup() | |
} |