I've been a long time Vim user, but the searching in a project is the missing part in Vim compare to TextMate. I used to switch to a command line using 'grep' or 'rak'(a ruby gem). Finally there is good tip how to integrate it into vim: Ack plugin for Vim
Here is how I do it on my Mac:
1. Install File-Next
2. Install ack
3. Edit your vimrc, add:
set grepprg=ack
4. Create a ack.vim in your .vim/plugin/
Fire up your vim:
:Ack text_to_search_in_current_path
Dec 22, 2008
Dec 18, 2008
dm 0.9.8 breaks YAML.dump
If you are wondering why your code stop working on dm 0.9.8, this could be one of the reason:
The DM 0.9.8 breaks the after you do any operation on the result Array:
So the workaround could be:
1. Issue only one query to get all you need
or
2. If you can not do 1, then you have to get all the ids, then use (:id.in => ids) to make it working.
Hope this could save you sometime to figure out the very strange error info.
Here is the ticket on light house.
The DM 0.9.8 breaks the after you do any operation on the result Array:
So the workaround could be:
1. Issue only one query to get all you need
or
2. If you can not do 1, then you have to get all the ids, then use (:id.in => ids) to make it working.
Hope this could save you sometime to figure out the very strange error info.
Here is the ticket on light house.
Dec 10, 2008
A little tiny bug in Phusion Passenger 2.0.5
If you are using Phusion Passenger like me, I believe you would love it very much. It is such an effort saver. So I've put it on all my machines, even on my dev. , testing and staging machines. But some times I want my Rack apps started in a development mode, so I went through Passenger's document, and added RackEnv environtment variable.
After a restart, I've found that the app was still in production mode. Just played with it for a while and added some debug info, finally I found a workaround, that is, put the RackEnv outside the VirtualHost block.
I am hoping this will save you some time.
P.S. I've submitted a bug report on the issue tracker
After a restart, I've found that the app was still in production mode. Just played with it for a while and added some debug info, finally I found a workaround, that is, put the RackEnv outside the VirtualHost block.
I am hoping this will save you some time.
P.S. I've submitted a bug report on the issue tracker
Nov 24, 2008
Show what branch you are working on in a command prompt
Since I have to juggle between several projects on my typical day job, it would be nice if I can see which branch I am on in a git repository. I figured it out just a single line in my .bashrc:
local GIT='$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "($(git branch | grep '^*' |sed s/\*\ //))"; fi)'
Then add it to your prompt:
PS1="\u$....${GIT}${NONE}\$ "
Now I get:
~/Projects/spice-workspace/spice2(master)$ git checkout develop
~/Projects/spice-workspace/spice2(develop)$
Very cool!
local GIT='$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "($(git branch | grep '^*' |sed s/\*\ //))"; fi)'
Then add it to your prompt:
PS1="\u$....${GIT}${NONE}\$ "
Now I get:
~/Projects/spice-workspace/spice2(master)$ git checkout develop
~/Projects/spice-workspace/spice2(develop)$
Very cool!
Nov 11, 2008
link_to_action with confirmation
I like Merb, it gives you the best flexibility to extends or hack by yourself. Unlike Rails which gives you every thing that you might need, in merb some of the basic features may need polished. For example, the helper plugin have the delete_button helper method, it deletes the record without get any confirmation. Some times in my app, I want get the user's confirmation first. This is easy, implement your own helper method. There might be a better way to do this, but this works for me:
Nov 10, 2008
Git
I was having a problem with my git add -i command, here is the error message:
Can't locate Error.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.8.8 /System/Lib....
After playing with it for a while, I finally find that when I use mac port to install the git-core, it failed to copy the Error.pm file to the working directory. Here is how to fix it:
$sudo cp /opt/local/lib/perl5/vendor_perl/5.8.8/Error.pm /opt/local/lib/perl5/site_perl/5.8.8/.
I am hoping this could save someone sometime to find the answer.
Can't locate Error.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.8.8 /System/Lib....
After playing with it for a while, I finally find that when I use mac port to install the git-core, it failed to copy the Error.pm file to the working directory. Here is how to fix it:
$sudo cp /opt/local/lib/perl5/vendor_perl/5.8.8/Error.pm /opt/local/lib/perl5/site_perl/5.8.8/.
I am hoping this could save someone sometime to find the answer.
Subscribe to:
Posts (Atom)