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
@ingconti
ingconti / QRImage.swift
Created June 8, 2019 12:12
QRCodeImage for iOS and OSX: allows to create a correct QR code without blur (ported from https://gist.github.com/snej/c210cc4cbfe8fd277186)
//
// QRImage.swift
// QRCodeSample
//
// Created by ing.conti on 08/06/2019.
// Copyright © 2019 ing.conti. All rights reserved.
//
@alsibir
alsibir / # Vim Cheatsheet
Last active February 13, 2024 14:43
[.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
@AmatsuZero
AmatsuZero / proxyStatus.swift
Created August 14, 2018 02:45
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,
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"
@laixintao
laixintao / Git常用命令.sh
Last active August 20, 2022 06:52
一些常用的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------------------------------
@onmyway133
onmyway133 / Init in protocol extension.swift
Last active June 7, 2019 10:01
Init in protocol extension.swift
protocol P {
init()
}
extension P {
init(something: AnyObject) {
self.init()
print("P")
}
}
@takuoka
takuoka / AutoGrowingTextField.swift
Last active January 18, 2022 13:02
Example of an NSTextField that expands its height automatically. https://github.com/DouglasHeriot/AutoGrowingNSTextField
import Cocoa
// https://github.com/DouglasHeriot/AutoGrowingNSTextField
// for AutoLayout
class AutoGrowingTextField: NSTextField {
var minHeight: CGFloat? = 100
xcrun llvm-cov report -use-color=true -instr-profile \
./Build/Intermediates/CodeCoverage/Coverage.profdata \
./Build/Intermediates/CodeCoverage/MyApp/Products/Debug-iphonesimulator/MyApp.app/MyApp
@csmoore
csmoore / FindAndReplaceString
Created April 3, 2015 16:06
Simple find and replace string in files (recursive) python script
#------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos