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
// https://muukii.design/engineering/2017/10/17/create-cgaffinetransform-that-represents-cgrect-to-cgrect | |
extension CGAffineTransform { | |
init(from: CGRect, to: CGRect) { | |
self = CGAffineTransform( | |
a: to.width / from.width, | |
b: 0, | |
c: 0, |
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
import MapKit | |
// http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/ | |
private let mercadorRadius: Double = 85445659.44705395 | |
private let mercadorOffset: Double = 268435456 | |
private func longitudeToPixelSpaceX(longitude: Double) -> Double { | |
return round(mercadorOffset + mercadorRadius * longitude * .pi / 180.0); | |
} |
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
# setup | |
# pip install cryptography pyjwt | |
# ref. | |
# http://gobiko.com/blog/token-based-authentication-http2-example-apns/ | |
import jwt | |
import time | |
ALGORITHM = 'ES256' |
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
import UIKit | |
final class HardRubberbandView: UIView, UIScrollViewDelegate { | |
var contentSize: CGSize = .zero { | |
didSet { | |
scrollView.contentSize = contentSize | |
contentView.frame.size = contentSize | |
} | |
} | |
@objc |
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
//: [Previous](@previous) | |
import Foundation | |
import UIKit | |
import XCPlayground | |
enum ParseError: Swift.Error { | |
case notSatisfy | |
} |
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
// | |
// main.swift | |
// Formula | |
// | |
// Created by 林達也 on 2016/03/20. | |
// Copyright © 2016年 jp.sora0077. All rights reserved. | |
// | |
//: Playground - noun: a place where people can play |
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
// Playground - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
protocol ObjectProtocol {} | |
protocol QuerySetProtocol { | |
} |
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
import UIKit | |
import XCPlayground | |
enum Path: Equatable { | |
case Current | |
case Parent | |
case Root | |
case Letter(String) | |
} |
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
``` | |
pip install rstr | |
pip install jinja2 | |
``` | |
`Python 3.4.1` |
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
#import <Foundation/Foundation.h> | |
@interface NSString (NSUserDefaults) | |
@property BOOL defaultsBool; | |
@property NSInteger defaultsInteger; | |
@property float defaultsFloat; | |
@property double defaultsDouble; | |
@property id defaultsObject; | |
@property NSData *defaultsData; | |
@property NSString *defaultsString; |
NewerOlder