#Hello Edgerunners, welcome to the Night-City.

Welcome!

OS X: csrutil

El Capitan 加入了 Rootless 机制, 不再能够随心所欲的读写很多路径真是很难过。 Rootless 机制将成为对抗恶意程序的最后防线 要关闭 Rootless, 需要进入恢复系统。开机时按住 option 选择恢复磁盘 (或在开机时按住 command + R), 在菜单中找到并打开 Terminal。 csrutil disable 然后重启即可。 如果要恢复默认: csrutil enable csrutil csrutil enable [--without kext | fs | debug | dtrace | nvram][--no-internal]...

Glücklich ist, wer vergisst, was nicht zu ändern ist.

快乐就是忘记不能改变的事情。

max-height: x% doesn't work on Chrome

Some times using percentages for fluidity in layouts is tricky because you have to deal with containers and border-type things. Look in to using viewport units and learn some thing about it on css-tricks and caniuse will show you how well it's supported. Essentially you can say: <div style="...

Swift: Optional Protocol Methods Without @objc

Objective-C 协议 (protocol) 在 Swift 中是一个特殊的存在, 当你使用 @objc 标记一个协议, LLVM 会生成一系列额外内容: 一个 isa 指针 运行时模块, 例如 __objc_imageinfo、__objc_classref 等 Swift 协议并不支持可选 (optional), 除非我们将协议导出到 Objective-C, 因为这时它们已经变成了 Objective-C 协议。 此外, 这些协议也不能用于扩展 (extension)、枚举 (enum) 和结构体 (struct), 作用十分有限, 如果你在 Linux 环境下使用 Swift...

Cocoa: Change Cursor

The way to change the cursor when it's over an NSButton: First, you should subclass NSButton first, then add the code below: @property (strong) NSCursor *cursor; - (void)resetCursorRects { if (self.cursor) { [self addCursorRect:[self bounds] cursor: self.cursor]; } else { ...

CSS Selectors Level 4

关于 CSS Selectors Level 4 阶段性新特性的总结。 Negation pseudo-class :not :not 用于将符合规则的元素剔除, 将样式规则应用于其他元素上。 在 CSS3 中已经有 :not, 不过在 CSS3 中只能使用简单的匹配规则, 例如 :not(p) 用来选择不是 <p> </p> 的元素。 在 CSS4 中, 可以应用更复杂的匹配规则, 但是同样地不允许嵌套使用, 例如 :not(:not(...))。 .negation { color: black; } .negation .default:not([data...

Cocoa: Sending mail via Python

偶然看到一个讨论, 需求很简单, 单纯的 SMTP 邮件发送。 这样的话我想 Python 应该是一个不错的选择, 那么首先我们需要写一个 Python 程序, 我们将它保存为 mail.py: import os import smtplib import json from email import Encoders from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.Utils im...

Sparkle 2: Publishing an update

配置好一些基本的内容后,是时候发布一个新版本了。 归档 首先你需要归档你的应用。 如果你使用 DMG,归档后不要再次压缩 .dmg 文件 如果你使用 ZIP,你可以通过 ditto -c -k --sequesterRsrc --keepParent 应用路径 压缩包目标路径 创建 如果你使用 PKG,保证 PKG 文件与应用同名,并以上述的任意一种形式归档 默认状态下 Sparkle 会使用 GUI 进行安装 如果你使用 .sparkle_guided.pkg 后缀而非 .pkg 则 Sparkle 不会显示 GUI,而在后台安装,不需要用户确认每一步 安全性措施 为了提升安全性、避免中...

Sparkle 1: Setup

做 Mac 开发的同学应该至少都听说过 Sparkle,一个应用升级框架,Sparkle 是开源的,参考 Github。 不过需要注意的是,Sparkle 的使用场景应仅仅局限于 非 App Store 且非 Sandbox 应用。 使用 Sparkle 几乎不需要写代码,但需要做一些 Xcode 配置还是必要的。 添加 Sparkle 到你的项目 CocoaPods: pod 'Sparkle' 记得要使用 use_frameworks!。 手动 下载 最新版本 用 Xcode 打开你的项目并将 Sparkle.framework 文件拖入你 拖入时请勾选 Copy ...

颓废了一阵子,又雀跃了一阵子,但不论是怎样的感情,就像这四年间许许多多不明的日子一样,都会过去。

people come and go, but coffee is forever.

NSImage: Get size in pixels

Just simple: let rep = originImage.representations.first let pixelSize = CGSize(width: (rep?.pixelsWide)!, height: (rep?.pixelsHigh)!) ...

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