Homebrew update的问题

OS X 某个版本后,执行brew update会遇到一些问题,原因应该是 /usr/local 目录的所属变成了admin,改为自己即可。

1
2
3
4
5
6
7
8
9
MacBook-Pro:~ fang$ brew update && brew upgrade
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami):admin /usr/local

IBOutletCollection

参考链接: http://www.cocoachina.com/ios/20150514/11807.html
http://stackoverflow.com/questions/15836930/how-can-i-use-iboutletcollection-to-connect-multiple-uiimageviews-to-the-same-ou

Linux install rubygems

CentOS

1
2
3
4
sudo yum install ruby
sudo yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel
sudo yum install ruby-rdoc ruby-devel
sudo yum install rubygems

php-resque 的安装和使用

安装

1
2
3
4
5
6
7
8
## 安装 Composer
curl -s http://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

## 安装 php-resque
git clone https://github.com/chrisboulton/php-resque.git
cd php-resque
composer install

Android 卸载所有第三方应用

adb shell pm list packages 列出所有包名
adb uninstall PACKAGE_NAME 卸载

1
2
3
4
5
6
7
#!/bin/bash

for package_name in `adb shell pm list packages -3 | awk 'BEGIN { FS = ":|\r" } { print $2 }'`; do
echo adb uninstall ${package_name}
adb uninstall ${package_name}
echo -------------
done

adb 命令

参考链接

NSMutableArray arrayWithCapacity

NSMutableArray -init vs. +arrayWithCapacity:

参考链接:
http://stackoverflow.com/questions/22395963/understanding-arraywithcapacity-method-on-nsmutablearray
http://stackoverflow.com/questions/1730706/nsmutablearray-init-vs-arraywithcapacity

JavaScript alert not working in Android WebView

参考链接

Call to undefined function curl_init()

参考链接: http://stackoverflow.com/questions/6382539/call-to-undefined-function-curl-init

Root view controller

参考链接: http://stackoverflow.com/questions/30884896/application-windows-are-expected-to-have-a-root-view-controller-at-the-end-of-a