Skip to content

Instantly share code, notes, and snippets.

View KittenYang's full-sized avatar
🚀
Rush

Qitao Yang KittenYang

🚀
Rush
View GitHub Profile
@natowi
natowi / audio2midi.md
Last active November 1, 2024 06:36
List of open source audio to midi packages
@tmspzz
tmspzz / NRFileManager.swift
Last active August 27, 2024 20:29
A method to calculate the accumulated size of a directory on the volume in bytes.
public extension FileManager {
/// This method calculates the accumulated size of a directory on the volume in bytes.
///
/// As there's no simple way to get this information from the file system it has to crawl the entire hierarchy,
/// accumulating the overall sum on the way. The resulting value is roughly equivalent with the amount of bytes
/// that would become available on the volume if the directory would be deleted.
///
/// - note: There are a couple of oddities that are not taken into account (like symbolic links, meta data of
/// directories, hard links, ...).
@ericdke
ericdke / splitBy.swift
Last active July 10, 2023 09:55
Swift: split array by chunks of given size
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
extension Array {
func splitBy(subSize: Int) -> [[Element]] {
return 0.stride(to: self.count, by: subSize).map { startIndex in
let endIndex = startIndex.advancedBy(subSize, limit: self.count)
return Array(self[startIndex ..< endIndex])
}
}
}
@JeOam
JeOam / Bundle.md
Last active June 21, 2018 09:46
Get Bundle ID of Any App

获取应用的 Bundle ID 方法:在 iTools 下,找到 app 名字命名的文件夹 xxx.app,找到 Info.plist,导出,Xcode 打开。

得到 Bundle ID 如:

com.tencent.mipadqq  iPad 版 QQ 4.1
com.tencent.xin  微信 5.3.1.17
@mmorey
mmorey / .gitignore
Last active November 9, 2018 16:20 — forked from adamgit/.gitignore
.gitignore file for Xcode5
#########################
# .gitignore file for Xcode5
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
# and https://gist.github.com/adamgit/3786883
@OliverLetterer
OliverLetterer / XCDUUID.m
Created January 26, 2013 17:05
With this gist, I, as a total assembly noob, am trying to understand the XCDUUID runtime hack (https://github.com/0xced/NSUUID/blob/1.0.1/NSUUID.m#L167-L221) to be able to use NSUUID on iOS < 6.0.
@implementation XCDUUID
+ (void) load
{
// query runtime if NSUUID class already exists, if so => done
if (objc_getClass("NSUUID"))
{
return;
}