Skip to content

Instantly share code, notes, and snippets.

View XuYanci's full-sized avatar
🏠
Working from ShenZhen

XuYanCi @许小易 XuYanci

🏠
Working from ShenZhen
View GitHub Profile
@XuYanci
XuYanci / proxyStatus.swift
Created September 8, 2022 07:04 — forked from AmatsuZero/proxyStatus.swift
iOS端检查是否设置了代理
/// 是否设置了代理
///
/// - 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,
@XuYanci
XuYanci / # Vim Cheatsheet
Created June 11, 2021 09:08 — forked from alsibir/# Vim Cheatsheet
[.vim] vim #vim
# 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
@XuYanci
XuYanci / Git常用命令.sh
Created June 11, 2021 09:05 — forked from laixintao/Git常用命令.sh
一些常用的git命令 速查表
------------------------------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------------------------------
@XuYanci
XuYanci / linkmap.js
Created July 16, 2018 06:23 — forked from bang590/linkmap.js
XCode Linkmap Parser
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);
@XuYanci
XuYanci / git-flow.md
Created May 15, 2018 08:35 — forked from yesmeck/git-flow.md
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。

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"
@XuYanci
XuYanci / Init in protocol extension.swift
Created January 9, 2018 02:00 — forked from onmyway133/Init in protocol extension.swift
Init in protocol extension.swift
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

Videos