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 | |
| # Universal iOS Build and Launch Script | |
| # Automatically detects project settings or accepts command-line options | |
| # | |
| # Usage: ./ios-build-and-launch.sh [OPTIONS] [device-name] | |
| # | |
| # Options: | |
| # --project PATH Path to .xcodeproj or .xcworkspace (auto-detected if not provided) | |
| # --scheme NAME Scheme name (auto-detected if not provided) |
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
| # Uncomment the next line to define a global platform for your project | |
| #platform :ios, '11.0' | |
| target 'Family' do | |
| # Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
| use_frameworks! | |
| # Pods for Family | |
| pod 'Alamofire', '~> 4.5' | |
| pod 'SwiftyJSON', '~> 4.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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "time" | |
| "github.com/sirupsen/logrus" | |
| ) |
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 binarysearch | |
| import ( | |
| "errors" | |
| ) | |
| func BinarySearch(a []int, target int) (int, error) { | |
| startPos := 0 | |
| endPos := len(a) |
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 cache | |
| type Cache interface { | |
| Get(key string) interface{} | |
| Set(key string, value interface{}) | |
| } | |
| type CacheNode struct { | |
| Key string | |
| Value interface{} |
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 each machine | |
| ETCD_VERSION=v3.2.5 | |
| TOKEN=taipei101-etcd-token | |
| CLUSTER_STATE=new | |
| NAME_1=core-1 | |
| NAME_2=core-2 | |
| NAME_3=core-3 | |
| HOST_1=10.0.1.1 | |
| HOST_2=10.0.1.2 | |
| HOST_3=10.0.1.3 |
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
| docker service create \ | |
| --network traefik-net \ | |
| --name gogs \ | |
| --mount src=gogs,dst=/data \ | |
| --constraint node.hostname=="hostname-1" \ | |
| --label traefik.port=3000 \ | |
| --label traefik.frontend.rule=Host:git.xxx.com \ | |
| gogs/gogs |
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
| ./cockroach start --background --certs-dir=certs --advertise-host=10.140.1.1 |
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
| docker run -d --restart always --net host --name consul \ | |
| consul agent -server -bootstrap-expect=3 -retry-join=10.140.1.2 -retry-join=10.140.1.3 -bind=10.140.1.1 -ui -client=10.140.1.1 |
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
| 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 - |
NewerOlder