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 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" |
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
/// 是否设置了代理 | |
/// | |
/// - 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, |
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
# 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 |
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
// | |
// QRImage.swift | |
// QRCodeSample | |
// | |
// Created by ing.conti on 08/06/2019. | |
// Copyright © 2019 ing.conti. All rights reserved. | |
// | |
OlderNewer