2011/08/23

Git get diff file list and diff content from some branch

  1. BRANCH_NAME='dev'
  2. SOURCE_DIR='/home/me/src'
  3. EXPORT_TO='/home/me/out'
  4.  
  5. cd $SOURCE_DIR
  6. git diff --name-only $BRANCH_NAME > $EXPORT_TO/changes.txt
  7. git diff $BRANCH_NAME > $EXPORT_TO/changes.diff
  8.  

2011/08/12

Unix like shell - find_keywords

  1. #!/bin/sh
  2. if [ "xx$2" != "xx" ] && [ -e $2 ]; then
  3.     echo finding $1 in $2
  4.     if [ "xx$WINDIR" != "xx" ]; then
  5.         grep -lr $1 $2 | sed 's~/~\\~g' | sed 's~^\\\(\w\)\\~\U\1:\\~g'
  6.     else
  7.         grep -lr $1 $2
  8.     fi
  9. else
  10.     echo first param must be search string
  11.     echo second param must be full path
  12. fi

2011/08/10

CodeBlocks 中文化

下載mo檔:
codeblocks translation page
www.badongo.com - Click Here to Download codeblocks zh_TW
www.u-file.net - Click Here to Download codeblocks zh_TW

然後建一個目錄 C:\Program Files\CodeBlocks\share\CodeBlocks\locale\zh_TW
其中 C:\Program Files\CodeBlocks 是安裝路徑
然後把mo檔放到裏面去

Settings -> Environment -> View -> Internationalization
勾起來 -> 選 Chinese
然後重開CodeBlocks

搞定...

BTW...中文化以後, syntex highlight好像消失了...
所以還是把勾勾拿掉好了....sigh.....