#Hello Edgerunners, welcome to the Night-City.

Welcome!

sudo rm -rf /

今天做了一件非常糟糕的事情, 由于一个玩笑导致朋友用 rm 误删了很多重要的文件。 起初是因为印象里 Mint 中 sudo rm -rf / 这个指令不会被执行, 以为 macOS 中也是这样, 但很快就被现实打脸了。 为了防止类似的悲剧再次发生, 我也开始思考怎样避免这种危险的操作 (除了管好我的嘴之外)。 safe-rm 第一种最简单的方法, 安装 safe-rm, 你可以在它的官方网站中下载安装并查看相关的说明文档。 它的使用十分简单, 下载并解包后, 复制 safe-rm 文件到 /usr/bin 路径, 并配置到 $PATH 靠前的位置。 $ cp safe-rm /usr/bin...

StaSh: Shell Like an Expert in Pythonista

StaSh is a serious attempt to implement a Bash-like shell for Pythonista, inspired by shellista and its variants Since its initial release, valuable contributions and advices have been received constantly from the Pythonista community. The two most popular utilities are pip (authored by @briarfox) a...

iOS : 模拟微信红包照片

上一篇博客用 HTML5 + CSS3 实现了一个简单的微信红包照片的效果,那当然少不了街机 iPhone 中的实现。 iOS 实现这个效果常用的有三种方式: CoreImage 绘图 CALayer UIVisualEffectView 其实都比较简单,这里介绍一下第一种。首先创建一个 UIImageView 供展示图片。 UIImageView *imgView = [[UIImageView alloc] initWithFrame:self.view.bounds]; [imgView setContentMode:UIViewContentModeScaleAspec...

HTML5/CSS3: 模拟微信红包照片

前几天微信红包照片着实火了一把,很多人也已经发现可以通过抓包获取到原始图片,而其背后的实现方式也引起了一些朋友的兴趣。 所以今天我们一起实现一个简单的微信红包照片效果。 首先,根据标题你已经知道我们要使用 HTML5 和 CSS3 来实现。那么新建一个 HTML5 文件吧。 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="description" content="Blu...

Using the View Hierarchy and Console for easier debugging

At some point in life, you are gonna work with a codebase that you didn't write from the very beginning. Specially if you are maintaing it, one of the biggest questions often is 'where to start looking in order to fix bug Y?'. Most of the times, there will be a strong relationship with what you see ...
Papers

Objective-C: weakSelf

The correct way to define a weak object is: __typeof__(obj) __weak wobj = obj; Note that having __weak before the type is technically incorrect. However, you can find this in AFNetworking's AFURLConnectionOperation.m codes: __weak __typeof(&*self)weakSelf = self; But the __typeof__((__typeof...

What is System Integrity Protection (aka Rootless) and how to disable it

All Macs with OS X El Capitan installed on them have a new layer of security known as System Integrity Protection, which has been given the nickname Rootless because it closes off a lot of system files to user access to prevent malicious programs and code from causing harmful changes to the core of ...

AppleDoc: Docset Generator

Appledoc 是一个命令行工具,用来生成 .docset 文件。 文档风格默认与苹果保持一致的。 开源 生成 docset 并自动集成到 Xcode 中 没有特殊的注释要求,可以用 /** */ 的格式,也兼容 /*! */ 格式 Installnation 直接使用 brew 即可: brew install appledoc Usage 常用的指令是这样的: appledoc 项目路径 -o 输出路径 -p 项目名 -c 公司名 命令执行完毕后会在给定的输出目录生成 docset-installed.txt 文件,其中标明了文档所在位置,默认集成到 ~/Librar...

CoreData 与 SQLite 线程安全

数据库读取操作一般都是多线程访问的。在对数据进行读取时,我们要保证其当前状态不能被修改,即读取时加锁,否则就会出现数据错误混乱。 iOS中常用的两种数据持久化存储方式: CoreData SQLite 两者都需要设置线程安全,在这里以FMDB来解释对SQLite的线程安全访问。 FMDB 没有线程安全的执行方式 FMDatabase *database = [FMDatabase databaseWithPath:[self getDatabasePath]]; //打开数据库 [database open]; NSString *sql = @"create table ...

Concatenate arrays in liquid

今天在使用 Jekyll 时遇到一个问题: 数组合并。 第一反应是使用 concat 过滤, 但是实际操作后并没有效果。查阅了一些 资料 发现, 虽然 Liquid 本身已经支持 concat, 但并不包括在 Liquid 核心部分中, 因此在目前 Jekyll 的稳定版本中尚未实现。 关于 concat 过滤器的示例请参见: https://help.shopify.com/themes/liquid/filters/array-filters#concat 与此同时, 解决方案至关重要: =begin Jekyll filter to concatenate arrays Us...

笑顔がー番

What's this?

The Night-City version of Hotodogo 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.

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

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

热爱苹果、钟情色彩。

随时恭候 垂询

Outer Square Inner Square