master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。
开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。
/// 是否设置了代理 | |
/// | |
/// - Returns: 代理设置情况 | |
func getProxyStatus() -> Bool { | |
guard let proxySettings = CFNetworkCopySystemProxySettings()?.takeUnretainedValue(), | |
let url = URL(string: "https://www.baidu.com") else { | |
return false | |
} | |
let proxies = CFNetworkCopyProxiesForURL((url as CFURL), proxySettings).takeUnretainedValue() as NSArray | |
guard let settings = proxies.firstObject as? NSDictionary, |
# Vim Cheatsheet | |
>Disclaimer: This cheatsheet is summarized from personal experience and other online tutorials. It should not be considered as an official advice. | |
## Global | |
```bash | |
:help keyword # open help for keyword | |
:o file # open file | |
:saveas file # save file as | |
:close # close current pane |
------------------------------commit------------------------------ | |
$ git status # 检查文件当前的状态 | |
$ git add [文件名] # 追踪新的文件 | |
$ git diff --cached # 若要看已经暂存起来的文件和上次提交时的快照之间的差异 | |
$ git commit -m "Story 182: Fix benchmark" # 用一行命令提交更新 | |
$ git commit -a -m 'added new benchmarks' # 跳过add命令直接提交 | |
$ git rm --cached log.log # 从git仓库中删除不小心追踪的文件(用于gitignore之前追踪的文件) | |
$ git mv file_from file_to # 移动文件/重命名文件 | |
------------------------------branch------------------------------ |
var readline = require('readline'), | |
fs = require('fs'); | |
var LinkMap = function(filePath) { | |
this.files = [] | |
this.filePath = filePath | |
} | |
LinkMap.prototype = { | |
start: function(cb) { |
alert('hello ' + document.location.href); |
class APICaller { | |
var url:URL? | |
var method = HTTPMethods.get | |
var params:[String:String]? | |
enum HTTPMethods: String { // http methods | |
case get = "GET" | |
case post = "POST" | |
case put = "PUT" |
protocol P { | |
init() | |
} | |
extension P { | |
init(something: AnyObject) { | |
self.init() | |
print("P") | |
} | |
} |
xcrun llvm-cov report -use-color=true -instr-profile \ | |
./Build/Intermediates/CodeCoverage/Coverage.profdata \ | |
./Build/Intermediates/CodeCoverage/MyApp/Products/Debug-iphonesimulator/MyApp.app/MyApp |