Skip to content

Instantly share code, notes, and snippets.

View manajay's full-sized avatar
🎯
Focusing

manajay manajay

🎯
Focusing
View GitHub Profile
@manajay
manajay / NSTextAttachment.txt
Last active May 10, 2018 05:18
NSTextAttachment 简单使用
NSTextAttachment *imageAttachment = [[NSTextAttachment alloc] init];
imageAttachment.image = image;
imageAttachment.bounds = CGRectMake(0, 0, 30, 30);
NSDictionary *imageAttributes = @{NSAttachmentAttributeName:imageAttachment};
NSAttributedString *imageAttStr = [[NSAttributedString alloc] initWithString:@"" attributes:imageAttributes];

Keybase proof

I hereby claim:

  • I am manajay on github.
  • I am manajay (https://keybase.io/manajay) on keybase.
  • I have a public key whose fingerprint is 2712 0E68 1885 C2A6 B484 B367 18BC 23D1 3632 2525

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am manajay on github.
  • I am manajay (https://keybase.io/manajay) on keybase.
  • I have a public key whose fingerprint is 2712 0E68 1885 C2A6 B484 B367 18BC 23D1 3632 2525

To claim this, I am signing this object:

@manajay
manajay / gcd.codesnippet
Last active June 4, 2018 11:39
常用 gcd
/**
* 异步具备开线程的能力, 同步不具有
* 串行: 任务一个接一个, 依次执行
* 并发: 任务不相互依赖, 同时执行
*/
/**
* 快速迭代遍历 ,index不确定
* 和普通for循环一样,dispatch_apply和dispatch_apply_f函数也是在所有迭代完成之后才会返回,因此这两个函数会阻塞当前线程.
* 也就是说导致当前线程挂起, 去执行这个任务,千万注意添加的queue不要是串行的,会发生死锁.
@manajay
manajay / get_mobileprovision_uuid.sh
Last active April 22, 2018 15:24
获取描述文件的uuid脚本
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: getmobileuuid the-mobileprovision-file-path"
exit 1
fi
mobileprovision_uuid=`/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< $(/usr/bin/security cms -D -i $1)`
echo "UUID is:"
echo ${mobileprovision_uuid}
@manajay
manajay / get_uuid.sh
Last active May 10, 2018 05:17
查询描述文件的 uuid
// 方案1. 使用mac自带security命令行
security cms -D -i XXX.mobileprovision
// 方案2. mobileprovision-read命令
curl https://raw.githubusercontent.com/0xc010d/mobileprovision-read/master/main.m | clang -framework Foundation -framework Security -o /usr/local/bin/mobileprovision-read -x objective-c -
// 读取cer 公钥私钥
1. 合成 p12文件
2. 转换成pem文件
3.
@manajay
manajay / ios_cer.txt
Last active May 10, 2018 05:16
cer的知识
https://blog.csdn.net/ljb568838953/article/details/52879715
@manajay
manajay / dsym_uuids.sh
Last active May 10, 2018 05:16
mdfind uuid
#查询xxx uuid 的 dsym 文件
mdfind "com_apple_xcode_dsym_uuids == xxx"
@manajay
manajay / jenkins_boot.sh
Last active May 10, 2018 05:15
jenkins-boot
#!/bin/sh
# sudo chmod 777 赋予权限
# chmod +x 脚本可执行
# 加入到登录项
#启动jenkins, 下面指定的路径有 jenkins.war
java -Dorg.jenkinsci.plugins.gitclient.Git.timeOut=120 -jar ~/.jenkins/jenkins.war
@manajay
manajay / weakdance.codesnippet
Created May 10, 2018 05:14
weakdance in Objective-C
__weak __typeof(<#Type#>) weakSelf = self;
__strong typeof(weakSelf) strongSelf = weakSelf;