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
| class ChatViewController: JSQMessagesViewController { | |
| // 訊息資料 | |
| var messages = [[String: Any]]() | |
| // 訊息記錄節點 | |
| var messageRef: FIRDatabaseReference! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view. |
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
| export class AuthFormViewModel { | |
| email: string; | |
| password: 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
| package main | |
| import "fmt" | |
| // fibonacci is a function that returns | |
| // a function that returns an int. | |
| func fibonacci() func() int { | |
| a := 0 | |
| b := 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
| # folder jenkins | |
| FROM jenkins:2.60.1 | |
| USER root | |
| RUN apt-get update \ | |
| && apt-get install -y sudo \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers |
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
| # | |
| pipeline { | |
| agent { | |
| docker { | |
| image 'node:8.1.0' | |
| args '-u root' | |
| } | |
| } | |
| stages { |
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
| pipeline { | |
| agent { | |
| docker { | |
| image 'node:8.1.0' | |
| args '-u root' | |
| } | |
| } | |
| stages { | |
| stage('Clean') { |
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
| // | |
| // API.swift | |
| // KLCC-SIGNBOOK | |
| // | |
| // Created by 默司 on 2017/7/4. | |
| // Copyright © 2017年 默司. All rights reserved. | |
| // | |
| import UIKit | |
| import RxSwift |
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 disposeBag = DisposeBag() | |
| // 模擬 indicator 顯示/隱藏狀態 | |
| let indicator = Variable(false) | |
| // 按鈕 | |
| lazy var loginButton: UIButton = { | |
| let button = UIButton(type: .system) | |
| button.tintColor = UIColor.red | |
| button.setTitle("登入", for: .normal) |
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 bag = DisposeBag() | |
| var hello = Variable(1) | |
| hello.value = 2 | |
| hello.value = 3 | |
| hello.value = 4 | |
| // subscribe => A => 4 | |
| hello.asObservable().subscribe(onNext: { (n) in |
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 | |
| extension Dictionary { | |
| subscript(string key: Key) -> String? { | |
| return self[key] as? String ?? nil | |
| } | |
| subscript(bool key: Key) -> Bool? { | |
| return self[key] as? Bool ?? nil | |
| } |