
Nov
20
UNIX/Linux : ranger
Published 12:11 Nov 20, 2014 by @ezra.
#Technology# ranger 是一款终端文件管理工具,它和大部分同类工具类似,除了它是左右结构。
在使用之前,你可能需要下载。
下载完成后,以 Ubuntu 为例,cd 到文件目录,执行 tar xvf ranger...

Nov
20
iOS: 用 Runtime 实现全局 NSCopying
Published 12:11 Nov 20, 2014 by @ezra.
#Programming# 给每个类手动添加 NSCopying 支持真的很累, 干脆一次性解决吧:
#import <Foundation/Foundation.h>
@interface MXObject : ...

Nov
16
iOS: UIView 绘制圆角矩形
Published 12:11 Nov 16, 2014 by @ezra.
#Programming# 绘制圆角矩形:
@implementation UIView (Draw)
void CGContextAddRoundRect(CGContextRef __nullable c, CGRect ...

Nov
12
iOS: UIImage gauss blur
Published 12:11 Nov 12, 2014 by @ezra.
#Programming# 为 UIImage 生成高斯模糊效果:
- (UIImage *)gaussBlurWithLevel:(CGFloat)blurLevel {
blurLevel = MIN(1.0, MA...

Nov
12
iOS: UIImage 获取主色调
Published 12:11 Nov 12, 2014 by @ezra.
#Programming# 获取一个 UIImage 实例的主色调:
// @implementation UIImage (Detector)
- (UIColor *)mainColor {
#if __IPHONE_OS...

Nov
06
Difference between enum and NS_ENUM in Objective-C
Published 12:11 Nov 06, 2014 by @ezra.
#Programming# First, NS_ENUM uses a new feature of the C language where you can specify the underlying type for an...

Nov
02
Git : 基本指令
Published 12:11 Nov 02, 2014 by @ezra.
#Version Control# 这一篇简单介绍下 Git 中基本的指令。
基本指令
git status: 查看 Git 文件状态,在Git 中文件有三种状态:
Untracked: 未追踪
Tracked & ...

Oct
31
数据结构与算法 11: 哈希表
Published 12:10 Oct 31, 2014 by @ezra.
#Programming# 什么是哈希表
哈希表就是一种以 键-值(key-indexed) 存储数据的结构,我们只要输入待查找的值即key,即可查找到其对应的值。
哈希的思路很简单,如果所有的键都是整数,那么就可以使用一个简单...

Oct
20
iOS: HTML 转 NSAttributedString
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 将 HTML 代码转换成属性文字, 其实很简单:
- (NSAttributedString *)attributedStringFromHTML {
NSData *data = [self...

Oct
20
iOS: NSLayoutConstraint 动画
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 直接上代码:
// @implementation NSLayoutConstraint (Animation)
- (void)setConstant:(CGFloat)constant anima...

Oct
20
iOS: NSString 替换 Unicode 字符
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 将 NSString 中的 Unicode 字符替换为 UTF-8 字符:
- (NSString *)stringByReplacingUnicodeWithUTF8 {
NSString ...

Oct
15
OS X: 制作 U 盘安装盘
Published 12:10 Oct 15, 2014 by @ezra.
#Programming# 总有人问怎么用 U 盘安装 OS X 系统,写个博客吧以后可以直接发链接了。
如何安装
首先打开终端,替换并输入下面这条指令:
sudo createinstallmedia文件路径 --volume...