Skip to content

Instantly share code, notes, and snippets.

@baijian
baijian / android-learning
Created July 7, 2013 08:13
some summary of developing android.....
fragment
=====
* initComponents
* initEvents
* initLogic
* onLoadComplement
* onItemClick
ssh connect slow:
change /etc/ssh/ssh_config to add
GSSAPIAuthentication no
run a shell in every 3 miniutes
*/3 * * * * /bin/bash /path/to/shell/script
sudp cp /usr/share/application/empathy.desktop eclipse.desktop
the number of significant digits displayed in floating point numbers.
precision = 14|12
当float超过14|12位时会自动用科学计数法表示,所以需要用$num = springf("%.0f", $number)
microtime()=>return a string
microtime(true)=>return a float
echo sprintf("$.0f", $microtime() * 1000000)
vim下查看文件编码
:set fileencoding
修改文件编码为utf-8
:set fileencoding=utf-8
unix2dos 是把linux文件格式转换成windows文件格式
@baijian
baijian / android-shell
Created November 6, 2013 10:15
android shell remount
> su
> mount | grep system
> mount -o rw,remount /dev/block/stl12 /system
> mount | grep system
> mount -o ro,remount /dev/block/stl12 /system
@baijian
baijian / test
Created November 10, 2013 13:31
test
## test
* fh
* $http_host equals always the HTTP_HOST request header.
* $host equals $http_host, lowercase and without the port number (if present), except when HTTP_HOST is absent or is an empty value. In that case, $host equals the value of the server_name directive of the server which processed the request.
@baijian
baijian / rspi
Created November 18, 2013 12:23
sudo dd bs=1M if=2013-09-25-wheezy-raspbian.img of=/dev/sdb
http://www.raspberrypi.org/downloads
redis-cli KEYS '_user_token_*' |xargs redis-cli DEL
@baijian
baijian / git
Created November 22, 2013 11:29
git fetch origin
git co gh-pages