Feeds:
Posts
Comments

Archive for the ‘Quick Tips’ Category

Generate Rails project for prior version

In the event you have multiple versions of the Rails gem and want to generate an older version, you can do the following:
rails _2.0.2_ myapp
This will create a new myapp directory with Rails version 2.0.2.

Read Full Post »

git checkout

This definitely falls in the duh! category:
If you delete a file and want to restore it to the trunk/master version, for subversion I would do:
svn update
to do the same with git:
git checkout <file>
Seems like this should have been obvious, but I guess I was expecting to find an update or restore or some other git [...]

Read Full Post »

Git and Tagging

Just a quick personal note on how to tag so I don’t have to look it up again. I’m not sure if this is right.?
git tag -a rel_0.0.0git push –tags

Read Full Post »

collect and flatten

I run into this scenario many times and never really thought about changing it until recently. It’s very common, I have an array of values and I want to perform an action on each item. My return value would be an array of the results from the action.
Here’s a sample lookup that most [...]

Read Full Post »

rake db:migrate:redo

Nice new rake command to rollback one migration and migrate back up. If you need to go further than one step back pass the STEP=x parameter.
#Roll back 3 migrations and migrate back to current version.rake db:migrate:redo STEP=3

Read Full Post »

Custom Rake tasks

Writing your own custom Rake task is very simple and almost not worthy of a blog post, but I can’t remember everything, so it’s here for reference.
In your lib/tasks directory create a file with the extension .rake. i.e. print.rake.

namespace :print do
task :one do
attention “One”
end

task [...]

Read Full Post »

Komodo Edit – Indenting

To indent a bunch of lines at once just highlight them and hit the Tab key (Shift-Tab to undo indention).

Read Full Post »

Starting lighttpd

I didn’t want lighttpd starting on boot so I removed it:sudo launchctl unload -w /Library/LaunchDaemons/org.macports.lighttpd.plistBut then I couldn’t figure out how to start it. Bummer. Then I finally found:/opt/local/etc/LaunchDaemons/org.macports.lighttpd/lighttpd.wrapper start

Read Full Post »

gem server

In the category of why I haven’t I used this yet (duh!):
run: gem_serverto run as daemon: gem_server –daemon
then access: localhost:8808
Documentation for your installed gems. Nice.
If you don’t have any documentation, run: gem rdoc –all
This will generate the docs for all the gems installed on your system.
Note: gem_server has been deprecated in favor of [...]

Read Full Post »