var foo = bar === 'xxx' ? true : false;
// 更好的代码是:
var foo = bar === 'xxx';两个和三个等号的判断,都是得到布尔值。
| # see http://web3dblog.wordpress.com/2012/03/30/installing-browserquest-on-amazon-ec2/ | |
| apt-get update | |
| apt-get upgrade | |
| apt-get install --yes build-essential g++ libssl-dev curl git-core | |
| apt-get install --yes libxml2-dev libssl0.9.8 | |
| export NODE_VERSION='0.6.8' | |
| wget http://nodejs.org/dist/node-v$NODE_VERSION.tar.gz |
| --- openvpn-2.2.2.orig/options.c 2011-12-14 00:58:56.000000000 +0800 | |
| +++ openvpn-2.2.2/options.c 2012-12-21 10:44:57.683130505 +0800 | |
| @@ -54,6 +54,10 @@ | |
| #include "memdbg.h" | |
| +extern char* _socket_obfs_salt; | |
| +extern int _socket_obfs_salt_len; | |
| +extern int _socket_obfs_padlen; | |
| + |
| --- src/openvpn/options.c.orig 2012-12-17 17:36:07.000000000 +0800 | |
| +++ src/openvpn/options.c 2013-03-07 23:21:26.230153027 +0800 | |
| @@ -62,6 +62,10 @@ | |
| #include "memdbg.h" | |
| +extern char* _socket_obfs_salt; | |
| +extern int _socket_obfs_salt_len; | |
| +extern int _socket_obfs_padlen; | |
| + |
| tell application "Messages" | |
| set isAppRunning to false | |
| tell application "System Events" | |
| if (exists process "Messages") then | |
| set isAppRunning to true | |
| end if | |
| end tell | |
| if isAppRunning is false then |
| /** 获取国内手机号运营商 | |
| * @param phone 手机号 | |
| * @return `U`是联通,`M`是移动,`T`是电信 | |
| */ | |
| +(NSString*)carrierOfPhone:(NSString*)phone{ | |
| if (phone.length>11) { | |
| //去掉乱七八糟的字符 | |
| phone=[[phone componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"+- "]] componentsJoinedByString:@""]; | |
| //如果86开头 去掉 |
| // | |
| // _oo0oo_ | |
| // o8888888o | |
| // 88" . "88 | |
| // (| -_- |) | |
| // 0\ = /0 | |
| // ___/`---'\___ | |
| // .' \\| |// '. | |
| // / \\||| : |||// \ | |
| // / _||||| -:- |||||- \ |
$ text-builder -index /path/to/index.txt
Or run $ sh build-all to build all your index files.本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.
| # Install google fonts | |
| git clone https://github.com/google/fonts.git | |
| sudo mkdir -p /usr/share/fonts/truetype/google-fonts/ | |
| find fonts/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; | |
| sudo apt-get install fontconfig -y | |
| sudo fc-cache -fv | |
在 Xcode 里下载文件真的是一种折磨, 特别是每次 Xcode 大版本更新都会遇到新的下载内容. 经过一翻周折, 本人找到一个方法可以轻松快速便捷地下载和安装对应的 Simulator 和 Doc 文件