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" | |
| "io/ioutil" | |
| "net/http" | |
| yaml "gopkg.in/yaml.v2" | |
| "github.com/gin-gonic/autotls" |
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/bash | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo apt-key fingerprint 0EBFCD88 |
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
| var express = require('express'); | |
| var path = require('path'); | |
| var favicon = require('serve-favicon'); | |
| var logger = require('morgan'); | |
| var cookieParser = require('cookie-parser'); | |
| var bodyParser = require('body-parser'); | |
| var index = require('./routes/index'); | |
| var users = require('./routes/users'); |
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 | |
| } |
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
| 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
| // | |
| // 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
| 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
| # | |
| 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
| # 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 |