CaveOps: Night-City
#Hello Edgerunners, welcome to the Night-City.

Welcome!

iOS 小知识: 去除 NSString 两端空白与空行

介绍一些 iOS 小知识。 去除 NSString 两端空白与空行" 去除两端空格 [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; 去除两端换行 [string stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; 去除两端空格和换行 [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewli...

iOS 小知识: 忽略编译器警告

介绍一些 iOS 小知识。 忽略警告 废弃 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" // 调用废弃方法... #pragma clang diagnostic pop 未使用的值 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-variable" int unused = 0; #pragma cl...

iOS 小知识: 模拟 Home 键点击

介绍一些 iOS 小知识。 模拟 Home 键单击 [[UIApplication sharedApplication] performSelector:@selector(suspend)]; 注意:这是私有 API...

iOS 小知识: 汉字转拼音

介绍一些 iOS 小知识。 汉字转拼音 @interface NSString (MandarinLatin) - (NSString *)stringByReplacingMandarinToLatinWithDiacritics:(BOOL)diacritics firstLetterCapitalizes:(BOOL)capitalizes; @end @implementation NSString (MandarinLatin) - (NSString *)stringByReplacingMandarinToLatinWithDiacritics:(BOOL)diacritics...

iOS 小知识: 生成随机浮点数

介绍一些 iOS 小知识。 生成随机浮点数 定义宏 #define ARC4RANDOM_MAX 0x100000000。 使用 arc4random() 来获取 0 ~ 100 的浮点数了: double val = floorf(((double)arc4random() / ARC4RANDOM_MAX) * 100.0f)...

iOS 小知识: 获取网页内容高度

介绍一些 iOS 小知识。 获取 Web 页面内容高度 利用 JavaScript 来实现,一般写在 UIWebView 代理中。 - (void)webViewDidFinishLoad:(UIWebView *)webView { CGFloat height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] doubleValue]; // ... } ...

iOS 小知识: 防止锁屏

介绍一些 iOS 小知识。 防止锁屏 [[UIApplication sharedApplication] setIdleTimerDisabled:YES];...

iOS apps and the Open Source they use

I've compiled a list of six popular iPhone apps and the iOS Open Source Software they use. I've also linked to the original repositories in case you want to check them out and start contributing to them. Projects that seem inactive, outdated or no longer maintained have been excluded from the list. ...

如何在 Github 搭建静态博客

其实最初做这个博客,可能是因为我暗藏了一颗文青的心,后来老有人问我博客怎么做的,想来想去干脆写个教程好了。 引言 这样的博客系统适合哪些人群呢? 不想、或者不愿意租用服务器 不想、或者不熟悉后端代码 更倾向于一个免费、永久、不限流量、速度靠谱的解决方案 没有太多时间维护 浏览量不大 可能只是出于一时兴趣 对代码感兴趣 具备一些编程基础知识 但是,也有一些弊端: 需要一些编程基础 不适合大型网站,内容过多会导致生成速度较慢 只能生成静态页面,动态功能仍旧需要使用外部服务,例如评论功能 此外,搭建博客系统又很多方式,例如使用 Hexo、Jekyll、Pelican 等。本文主要介绍 Jek...

iOS: 获取应用版本

获取 iOS 应用版本信息: - (NSString *)applicationVersion { return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; } - (NSString *)buildVersion { return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; } ...

UNIX/Linux Command: find

find 是 UNIX/Linux 系统中用于查找档案的命令,这里我们来看一下它的用法和相关选项。 命令用法 `find path -option [ -print ] [ -exec -ok command ] {} \; 使用说明 expression 中可使用的选项有二三十个之多,在此只介绍最常用的部分。 -exec:对搜索的结果执行指定的shell命令。注意格式要正确:-exec 命令 {} \;。注意{} 与\;之间有空格。 -mount,-xdev : 只检查和指定目录在同一个档案系统下的档案,避免列出其它档案系统中的档案 -amin -n: 在最近的 n 分钟内被...

reStructuredText 怎么玩

其实之前写过一篇 关于 AsciiDoc 的博文,其中提到过 reStructuredText ,最近赋闲,有朋友问了我关于 reStructuredText 的问题,于是也就有了写这篇语法入门的念头。 什么是 reStructuredText 简单说,reStructuredText 也是一种轻量级的文本标记语言,字面意思是 重构建的文本,是 Python 中 Docutils 项目的一部分,这也是为什么之前我一直说用 reStructuredText 感觉在写 Python 的原因。 reStructuredText 其一般保存的文件以 .rst 为后缀,必要时可以被转换为成 PDF、HT...

What's this?

The Night-City version of CaveOps inspired by Cyberpunk 2077. Not finished yet.

Pinned Message

The Founder and CEO of Infeca Technology.

Developer, Designer, Blogger.

Big fan of Apple, Love of colour.

Feel free to contact me.

反曲点科技创始人和首席执行官。

开发、设计与写作皆为所长。

热爱苹果、钟情色彩。

随时恭候 垂询