OS X: Best practical way to validate NSTouchBar items

Protocol and extensions: @available(macOS 10.12.1, *) protocol TouchBarItemValidations: class { func validateTouchBarItem(_ item: NSTouchBarItem) -> Bool } @available(macOS 10.12.1, *) extension NSTouchBarProvider { func validateTouchBarItems() { guard NSClassFromString(&quo...

系统基本配置概要

因为时不时会给自己或者被人的电脑💻重装系统, 装系统很简单, 但之后要配置的内容还是蛮多的, 这里列举一下吧。 重装系统 首先要从重装系统说起, 由于直接运行 .app 安装会保留原来的数据, 而很多时候这正是我们不希望看到的, 所以我们要用到 Terminal 来解决,详细内容可以参考我 之前的博客。 sudo createinstallmedia路径 --volume U盘路径 --applicationpath 安装器App路径 安装工具 rvm 接下来, 系统安装好之后先来安装 rvm 吧: \curl -sSL https://get.rvm.io | bash -s stabl...

Xcode: Showing TODO as a warnig in a Swift Xcode project

I rarely use comments when I’m coding1. I do make one exception though; using // TODO: and // FIXME: to highlight pieces of code I need to revisit at a later date. The advantage of doing this is that the lines then show up in the jump bar popover in bold text with one-click access to the exact line....

最近一些比较好的 jQuery 插件

最近一些比较好的 jQuery 插件。 Gradientify 是一个简单的 jQuery 插件,它提供了 CSS 梯度过渡效果。 PrognRoll 是一个微小的 jQuery 插件,用于在页面上创建滚动进度条。 您还可以自定义进度条。 jqGifPreview 是一个 jQuery 插件用来创建 GIF 预览就像 Facebook 和微博。 这个插件使用第一帧的 GIF 图像作为预览图像。 Shave 是一个零依赖 JavaScript 插件,它截断多行文本以适合根据 max-height 定好的 html 元素内。 Philte r是一个 jQuery 插件让你能够利用 H...

OS X: Setting up Spotlight Control in OS X El Capitan to macOS Sierra

OS X El Capitan introduced a new Security Feature called System Integrity Protection. With System Integrity Protection Bartender 2 needs additional setup steps performed before it can control Spotlight. Bartender 2 can control all other Apple menu items without these additional steps. Unfortunately ...

Why SVG?

SVG是什么? SVG是一种可缩放矢量图形 (英语: Scalable Vector Graphics, SVG) 是基于可扩展标记语言 (XML) , 用于描述二维矢量图形的图形格式。SVG由W3C制定, 是一个开放标准。 简单的理解, 它是图形的另一种格式例如它和常见的图片格式.png、.jpg、.gif等是一类。 SVG发展历程 2001年9月4日, 发布SVG 1.0 2003年1月4日, 发布SVG 1.1 2003年1月14日, 推出SVG移动子版本: SVG Tiny和SVG Basic 2008年12月22日, 發布SVG Tiny 1.2 2011年8月16日, 發布SVG...

iOS: in6_addr to string

将 struct in6_addr 转换为字符串: + (NSString *)formatIPV6Address:(struct in6_addr)ipv6Addr { NSString *address = nil; char dstStr[INET6_ADDRSTRLEN]; char srcStr[INET6_ADDRSTRLEN]; memcpy(srcStr, &ipv6Addr, sizeof(struct in6_addr)); if (inet_ntop(AF_INET6, srcStr, dstStr, INET6_AD...

SSL: certificate verify failed

今天在虚拟机里安装 CocoaPods 的时候,偶然遇到一个问题: $ gem install cocoapods ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://ruby.taobao.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (...

Xcode 8: Resource fork, Finder information, or similar detritus not allowed

最近 Xcode 8 中遇到这样一个错误: .app: resource fork, Finder information, or similar detritus not allowed 其实解决办法也简单,分别进入项目的目录、DerivedData 目录执行 xattr -rc . 即可。 参考内容: https://forums.developer.apple.com/thread/48726 https://forums.developer.apple.com/thread/48905 com.apple.FinderInfo ...

Swift 3: Basic Syntax

这里是一些 Swift 3 的基本语法示例,Swift 前几个版本变化较大,所以做一个总结。 虽然目前来说选择 Swift 做为商业应用的开发语言的维护成本还是很大,但始终是一个前进的方向。 控制台输出 let con = "something" print("content: \(con)") 常量和变量 常量使用 let 声明, 变量使用 var 声明。 自动推导 let b = 10 //Int let b1 = 10.0 //Double let b2 = "" //String let b3 = true //...

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