This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__uint64_t ttt = 0; | |
pthread_t pt = pthread_self(); | |
pthread_threadid_np(pt, &ttt); | |
NSLog(@"pid +++++:%llu", ttt); | |
参考: | |
https://stackoverflow.com/a/21206357/4626482 | |
https://opensource.apple.com/source/Libc/Libc-583/pthreads/pthread.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject; | |
NSString *file = [path stringByAppendingFormat:@"/test.txt"]; | |
const char *filePath = [[NSFileManager defaultManager] fileSystemRepresentationWithPath:file]; | |
FILE *fd = fopen(filePath, "a+"); | |
char *obj_file; | |
obj_file = malloc(PATH_MAX); | |
char buf[1024] = {'\0'}; | |
/** 在 iOS/MacOS 上测试拿不到绝对路径,https://stackoverflow.com/a/13544447/4626482 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SEL sel = NSSelectorFromString(@"adViewDismiss"); | |
static void(*action)(id, SEL) = (void(*)(id, SEL))objc_msgSend; | |
action(self, sel); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldName="$1" | |
newName="$2" | |
oldNameAll=""$oldName"*" | |
brew install rename ack | |
rm podfile.lock | |
rm -rf Pods | |
rm *.xcworkspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
添加tag: | |
git tag -a 版本号 -m "要添加的签名信息" | |
获取最新 tag 对应的签名信息 | |
git cat-file -p $(git rev-parse $(git tag -l | tail -n1)) | tail -n +6 | |
获取指定 tag 对应的签名信息 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
versionURL="https://xxx.json" | |
versionNum=`curl $versionURL | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["version"]' | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'` | |
// 获取对应的版本号 | |
python -c 'import json,sys;obj=json.load(sys.stdin);print obj["version"]' | |
// 版本号自增,如: 1.0.1 -> 1.0.2 | |
awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OS: Ubuntu 18 | |
树莓派 3B | |
服务端安装包下载地址: https://github.com/haiwen/seafile-rpi/releases | |
安装教程使用的英文版: https://manual.seafile.com/deploy/using_sqlite.html | |
以下操作均在 root 用户下完成 | |
问题1: | |
执行 setup-seafile.sh 脚本时提示: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
安装服务 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
NewerOlder