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
@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
alert('hello ' + document.location.href);
@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) {
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@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.
xcrun llvm-cov report -use-color=true -instr-profile \
./Build/Intermediates/CodeCoverage/Coverage.profdata \
./Build/Intermediates/CodeCoverage/MyApp/Products/Debug-iphonesimulator/MyApp.app/MyApp
@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
@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")
}
}
@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------------------------------