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://stackoverflow.com/a/29741007 | |
| /// | |
| let s = Struct() // Struct | |
| withUnsafePointer(to: s) { | |
| print(String(format: "%p", $0) | |
| } | |
| /// | |
| /// http://stackoverflow.com/a/36539213/226791 |
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
| /* | |
| CREATE文における各種データ型の設定 | |
| 擬似的にBOOLEAN型を設定 | |
| */ | |
| CREATE TABLE IF NOT EXISTS tests (id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| memo TEXT, | |
| image BLOB, | |
| type INTEGER, | |
| favorite BOOLEAN NOT NULL DEFAULT 0 CONSTRAINT testsFavorite CHECK (favorite IN (0, 1) OR favorite IS NULL), | |
| createdAt DATETIME |
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 CommonCrypto | |
| // MARK: AES128 暗号、復号化 | |
| public extension String { | |
| func aesEncrypt(key: String, iv: String) -> String? { | |
| guard | |
| let data = self.data(using: .utf8), | |
| let key = key.data(using: .utf8), | |
| let iv = iv.data(using: .utf8), |
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
| /** | |
| http://mythosil.hatenablog.com/entry/20111017/1318873155 | |
| http://blog.dealforest.net/2012/03/ios-android-per-aes-crypt-connection/ | |
| */ | |
| @interface NSData (AES) | |
| - (NSData *)AES128EncryptedDataWithKey:(NSString *)key; | |
| - (NSData *)AES128DecryptedDataWithKey:(NSString *)key; | |
| - (NSData *)AES128EncryptedDataWithKey:(NSString *)key iv:(NSString *)iv; |
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 | |
| open class MockResponse { | |
| static let errorDomain = "API Mock Error" | |
| enum ErrorCode: Int { | |
| case fileNotFound = -10001 | |
| case disableReadFile = -10002 | |
| var description: String { | |
| switch self { |
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
| $ brew install readline | |
| ==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Downloading patches | |
| ######################################################################## 100.0% | |
| ==> Patching | |
| patching file vi_mode.c | |
| patching file callback.c | |
| ==> ./configure --prefix=/usr/local/Cellar/readline/6.2.1 --mandir=/usr/local/Cellar/readline/6.2.1/share/man --infodir=/usr/local/Cellar/readline/6.2.1/share/info --enable-multibyte | |
| ==> make install |
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
| ############################### | |
| # get latest release git branch | |
| ############################### | |
| desc "get latest release git branch" | |
| private_lane :git_latest_release_branch do | |
| pattern = "release\/(.+)" | |
| branches = git_find_branches(pattern: pattern) | |
| reg = Regexp.new(pattern) | |
| branches = branches.sort { |a, b| |
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
| #!/bin/sh | |
| # ファイルの1年間のコミット数 | |
| git ls-files | | |
| while read file ; do | |
| commits=`git log --since=1.year --no-merges --oneline -- $file | wc -l`; | |
| echo "$commits - $file"; | |
| done | sort -n |
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
| Simulator起動時に `Lost connection to the debugger` と表示されてディタッチされてしまう&Simulator上でアプリが起動しない | |
| # https://developer.apple.com/forums/thread/681037 | |
| ``` | |
| settings set plugin.process.gdb-remote.packet-timeout 300 | |
| ``` |
NewerOlder