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
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@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
@tomasbasham
tomasbasham / UIImage+Scale.m
Last active February 1, 2024 19:04
Scale a UIImage to any given rect keeping the aspect ratio
@implementation UIImage (scale)
/**
* Scales an image to fit within a bounds with a size governed by
* the passed size. Also keeps the aspect ratio.
*
* Switch MIN to MAX for aspect fill instead of fit.
*
* @param newSize the size of the bounds the image must fit within.
* @return a new scaled image.
@bang590
bang590 / linkmap.js
Last active August 19, 2023 15:24
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);
@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,
@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------------------------------
@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
@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.
@nall
nall / makefile
Created June 4, 2009 22:34
USBTiny Example OSX Driver
all:
gcc -g -std=c99 -o usbtiny_osx usbtiny_osx.m -framework Foundation -framework IOKit
clean:
rm -rf usbtiny_osx