Friday, December 28, 2007

转换 Mp3 标签

记录备忘

sudo apt-get install python-mutagen
find . -iname "*.mp3" -execdir mid3iconv -e GBK {} \;

emacs 代码导航

emacs 自带的 ctags 不支持 ruby,安装 exuberant-ctags 提供 ruby 语言支持。

aptitude install exuberant-ctags

生成 TAGS

ctags -e -R ~/www/mephisto/

使用 tags 代码导航 copy 自 exuberant-ctags manpage:

HOW TO USE WITH GNU EMACS
       Emacs  will,  by default, expect a tag file by the name "TAGS" in the current directory. Once the tag file is built, the following commands exercise the tag indexing
       feature:

       M-x visit-tags-table  FILE 
                 Select the tag file, "FILE", to use.

       M-. [TAG] 
                 Find the first definition of TAG. The default tag is the identifier under the cursor.

       M-*       Pop back to where you previously invoked "M-.".

       C-u M-.   Find the next definition for the last tag.

       For more commands, see the Tags topic in the Emacs info document.

works almost great!

Tuesday, December 04, 2007

sugarcrm 定制开发小帖士

定制重复记录发现

sugarcrm 中的姓和名是分开的,对于中文来说,只需要一个字段即可,我们这里只使用了 last_name,first_name 一律留空,便于搜索。 sugarcrm leads 的“重复记录发现”功能默认匹配 first_name 和 last_name 字段,需要将 first_name 关闭。 打开 $PATH/include/SugarObjects/templates/person/vardefs.php,注释掉 first_name 的 merge_filter 键:

'first_name' =>
  array (
   'name' => 'first_name',
   'vname' => 'LBL_FIRST_NAME',
   'type' => 'varchar',
   'len' => '100',
   'unified_search' => true,
   'comment' => 'First name of the contact',
/** start customization */
           //'merge_filter' => 'selected',
/** end */   
          
  ),

Monday, December 03, 2007

emacs plugins

rcodetools

rcodetools is a collection of Ruby code manipulation tools for automagic Test::Unit(RSpec) assertion generation, code annotation, 100% accurate code completion, code & doc browsing, obtaining precise method info, meta-prog. aware, etc.
rcodetools will work better if you use it along with FastRI, an alternative to
the standard 'ri' documentation browser which features intelligent searching,
better RubyGems integration, vastly improved performance, remote queries via
DRb... You can find it at http://eigenclass.org/hiki.rb?fastri and it is also
available in RubyGems format:

   gem install fastri

Read README.emacs and README.vim for information on how to integrate
rcodetools in your editor.
sudo gem install rcodetools
gem install fastri
ln -s $PATH/rcodetools.el ~/emacs.d/libs
添加设定:
(require 'rcodetools)

参考: