Tinkering with Git + Quick Facebook App Template

Posted on February 17, 2008

I just got my new GitHub account – yay!

Time to tinker. One thing I’ve done with rails is create a “QuickStart Rails” template that I have checked into svn. It’s got several useful plugins that I use in just about all my rails apps, plus a working authentication system including all the boring, trivial details that come with that like ‘Forgot Password?’ functionality, etc.

Not all apps get the QuickStart rails treatment, but if they involve user authentication, I usually bootstrap the app using QS.

Recently I’ve been working on a Facebook app; following its development, I’ve made a Quick FB rails application template.

Again, this does all of the mundane things that all Facebook apps will require, like an Invitation page:

Facebook | Maven (Development)


If you’re interested, you can browse the git repository online.

To bootstrap a new Quick FB app (“fb_foo”) using git, do a:

git clone git://github.com/sbraford/quick-fb.git fb_foo

This will give you a complete Rails 2.0 application structure, plus:

  • rfacebook, will_paginate plugins already added
  • application.rb configured for you
  • User, Friendship models already created—as users add the application, they are automatically associated as Friends within your app
  • Invitation widget (like shown above) already included
See config/environment.rb for the list of TODOs once you have cloned the Quick FB git repo:

TODO after cloning the quick-fb git repo:

  1. Create your app's database.  Modify 'config/database.yml'.

  2. Open 'config/facebook.yml' and modify the following:

      key: YOUR_API_KEY_HERE
      secret: YOUR_API_SECRET_HERE
      canvas_path: /yourAppName/
      callback_path: /relative_root/
      sever_host: foo.com
      app_name: Foo App

  3. Modify the relative URL root below.

  4. Open up 'app/helpers/application_helper.rb' and modify the invitation text.

  5. Generate a new secret app key with:

        rake secret

  Copy & paste this into the session config section above. (this might not be necessary for fb apps, but just in case)

Note: to port this over to SVN, I believe you can simply do a:

  rm -rf .git/
  rm .gitignore  # and any other .gitignore files

... and you should be good to go. (copy to an existing svn repo and svn add/import as usual)

Recursively Remove .DS_Store Files and .svn Dirs

Posted on November 01, 2007

These commands are good to run right before doing a svn checkin for the first time.

Those pesky .DS_Store files on OS X:

find . -type f -name .DS_Store | xargs rm -rf

Let’s say you’ve copied over some files from another svn project. To remove the existing .svn dirs:

find . -type d -name .svn | xargs rm -rf

And for good measure, the Thumbs.db file that Windows generates automatically:

find . -type f -name Thumbs.db | xargs rm -rf