Skip to content

Instantly share code, notes, and snippets.

#route = 8.0.0.0/252.0.0.0
#route = 16.0.0.0/248.0.0.0
# 23.239 ip.cn (linnode),so sad
# 23.0 instagram & facebook CDN.If You Do Not Use ip.cn,
# replace the two line below with :
route = 23.0.0.0/255.0.0.0
#route = 23.0.0.0/255.128.0.0
#route = 23.174.0.0/255.192.0.0
route = 31.13.0.0/255.255.0.0
#route = 50.0.0.0/255.0.0.0
@samurai00
samurai00 / brew_php_issue.txt
Created August 25, 2014 14:29
brew upgrade php55 failed on 10.9.4
> brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: fc229eb78c6cd92c5e2592c28567e2e1704d4cb1
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9.4-x86_64
Xcode: 5.1.1
Clang: 5.1 build 503
@samurai00
samurai00 / array2text.php
Created May 14, 2014 08:04
simple array to simple text; simple text to simple array
<?php
$cats = array(
array(
'id' => 1,
'name' => 'level1_1',
'children' => array(
array(
'id' => 1,
'name' => 'level2_1',
'children' => array(
afon-MacBook-Pro:~ afon$ vim
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault: 11
afon-MacBook-Pro:~ afon$ brew doctor
Your system is ready to brew.
afon-MacBook-Pro:~ afon$ brew --config
HOMEBREW_VERSION: 0.9.5
@samurai00
samurai00 / gist:7297572
Created November 4, 2013 03:07
brew update, --config
afon-MacBook-Pro:~ afon$ brew update
Error: undefined method `factory' for Formula:Class
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/cmd/update.rb:61:in `update'
/usr/local/Library/Homebrew/cmd/update.rb:60:in `each'
/usr/local/Library/Homebrew/cmd/update.rb:60:in `update'
/usr/local/Library/brew.rb:95:in `send'
/usr/local/Library/brew.rb:95
afon-MacBook-Pro:~ afon$ brew --config
@samurai00
samurai00 / merge_proj.sh
Last active December 22, 2015 17:29
merge the cocos2d-x project for ios and android, use libs dir as cocos2d-x root; 合并iOS和Android项目cocos2d-x库文件,使用xcode生成的libs目录作为cocos2d-x根目录 (no box2d,chipmunk support)
#!/bin/bash
## set COCOS2DX_ROOT here ##
COCOS2DX_ROOT=/Users/afon/programs/cocos2d-x-2.1.5
echo "input your project dir:"
read APP_DIR
APP_LIBS_DIR=$APP_DIR/libs
cp_mk_cpp_h(){
@samurai00
samurai00 / set-proxy
Created September 9, 2013 01:38
set proxy on Mac using command
#!/bin/bash
USAGE="usage:set-proxy {eth|wifi} {socks|http|auto} {on|off|set} [addr] [port]"
if [[ $# -lt 3 ]]; then
echo ${USAGE}
exit 1
fi
INTERFACE=""
case $1 in
eth|tbt-eth)
@samurai00
samurai00 / set-vol
Created September 9, 2013 01:36
set volume on Mac using command
#!/bin/bash
let now_vol=`osascript -e 'output volume of (get volume settings)'`
case $1 in
up)
let vol=$now_vol+10
if [ "$vol" -gt 100 ] ; then
vol=100
fi
osascript -e "set volume output volume $vol"
echo "Volume: $vol"
@samurai00
samurai00 / gist:6247733
Last active December 21, 2015 04:09
brew doctor and brew --config output
afon-MacBook-Pro:local afon$ brew doctor
Your system is ready to brew.
afon-MacBook-Pro:local afon$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 5a9478e5a85475ac664671f1013cf116691103ff
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.8.4-x86_64