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
| /usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' |
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 XCTest | |
| class AsyncTests: XCTestCase { | |
| override func setUp() { | |
| super.setUp() | |
| // Put setup code here. This method is called before the invocation of each test method in the class. | |
| } | |
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 | |
| class ViewController: UIViewController { | |
| @IBOutlet weak var display: UILabel? | |
| @IBAction func add(sender: UIButton) { | |
| count++ | |
| } | |
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 | |
| var str = "Hello, playground" | |
| // Swiftの配列からNSDataへ変換 | |
| var rawArray:[UInt8] = [0x01, 0x02, 0x03]; | |
| let data = NSData(bytes: &rawArray, length: rawArray.count) | |
| print(data) | |
| // バイト列からNSDataに変換 |
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
| Travis CI メモ | |
| オープンソース向けのCIツール | |
| githubからソースをpull、スクリプトを動作させ、結果を通知する。 | |
| Xcodeのプロジェクトがビルドできる。(OS XのVMが走っている?未確認) | |
| Publicリポジトリであれば無料。 | |
| https://travis-ci.org | |
| Privateリポジトリを扱う場合は、有料のプラン契約が必要。 | |
| 月額129USD(13000JPY程度) |
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
| for i in stride(from: 0, to: 100, by: 25){ | |
| // 0, 25, 50, 75 | |
| println(i) | |
| } | |
| for i in stride(from: 0, through: 100, by: 25){ | |
| // 0, 25, 50, 75, 100 | |
| println(i) |
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 | |
| var str = "Hello, playground" | |
| class Counter:NSObject, NSCopying{ | |
| var count = 0; | |
| func add(){ |
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
| // Array to NSData | |
| var cArray:Array<UInt8> = [0x01, 0x02, 0x03] | |
| var data = NSData(bytes:cArray, length:sizeof(UInt8) * cArray.count) | |
| println(data) | |
| // NSData to Array | |
| var bufferArray:Array<UInt8> = [0x00, 0x00, 0x00] | |
| data.getBytes(&bufferArray, length:3) | |
| println(bufferArray) | |
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
| Bastille – Pompeii | |
| Jack White – Lazaretto | |
| Beck – Gamma Ray | |
| OneRepublic – Counting Stars | |
| MGMT – Electric Feel | |
| Sbtrkt – Wildfire (feat. Little Dragon) | |
| Wilco – You Never Know | |
| Mumford & Sons – I Will Wait | |
| Gorillaz – Stylo (feat. Mos Def and Bobby Womack) | |
| Daft Punk – Instant Crush |
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
| tell application "System Events" | |
| tell current location of network preferences | |
| set VPN to service "VPN" | |
| if exists VPN then disconnect VPN | |
| end tell | |
| end tell |