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
| ## ファイル名の取得 | |
| puts File.basename(__FILE__) | |
| ## 拡張子を除くファイル名 | |
| puts File.basename(__FILE__, File.extname(__FILE__)) | |
| ## 拡張子 | |
| puts File.extname(__FILE__) | |
| ## テキストファイルを読み込む |
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
| alert("hoge"); |
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
| //現在時刻 | |
| let now = NSDate() | |
| let cal = NSCalendar(identifier: NSCalendarIdentifierGregorian)! | |
| //10日後 | |
| let in10days = cal.dateByAddingUnit(.Day, value: 10, toDate: now, options: NSCalendarOptions()) | |
| //2日前 | |
| let ago2days = cal.dateByAddingUnit(.Day, value: -2, toDate: now, options: NSCalendarOptions()) |
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
| func deleteEvent(event: EKEvent) { | |
| do { | |
| try eventStore.removeEvent(event, span: .ThisEvent) | |
| } catch let error { | |
| print(error) | |
| } | |
| } |
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
| (function() { | |
| "use strict"; | |
| var Item, ItemRepository, User, addOnloadHandler, corsRequest, getElementsByClassName, main, setIframeHeight, setInnerText, template; | |
| Item = (function() { | |
| function Item(item) { | |
| var tag, _i, _len, _ref; | |
| this.title = item.title; | |
| this.url = item.url; | |
| this.tags = []; |
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, UITextFieldDelegate { | |
| @IBOutlet weak var textField: UITextField! | |
| override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { | |
| view.endEditing(true) | |
| } | |
| } |
OlderNewer