Thursday, August 28, 2008

Me lovin Git

As I stated previously, I am sold on DVCS, and today it just got better.

I came across a situation where I needed to share highly experimental code with a teammate. There was no way I could check this code into our normal repo, so what first pops into your head: email (strongbad style). You've been here and don't pretend you haven't used email. Oh yes the wonderful land of emailing around jar or zip files repeatedly.

Emailing source code around stopped today. Instead I got on the phone with Ron Alleva who helped walk me through the simple git commands to create my own local master repo. It was so simple it was ridiculous.

Here are the steps to create and share hack code in minutes

  1. install git
  2. cd to the folder you wish to share
  3. run git init
  4. run git add .
  5. run git commit -a
  6. Have your teammate clone it by running git clone ssh://user@host/path/to/repo.git/
Ironically after my teammate first cloned it and tested the code it failed because of a recent change I made. So I made the fix, committed it to my local repo, and he was able to git pull those changes. Also, if he makes any changes we can share them easily as well by him using git push.

Wednesday, August 27, 2008

Testing the new firefox plugin Ubiquity

Today I found out about the new experimental firefox plugin Ubiquity and I wanted to give a try in my blog. So far I am very impressed and it seems to be working fine on linux, even though the documentation says they don't support it yet (I am running Ubuntu 8.04 with firefox 3).

It was easy to install. After installation firefox takes you to the firefox egg about:ubiquity which contains one of the best tutorials I have ever followed.

To try it out you can get a map of where I work. First install ubiquity and highlight this address:

407 Pennsylvania Ave Joplin, MO

then invoke ubiquity (CRTL+SPACEBAR) and type map. Click on the map and then click on Insert map in page.

Pretty slick. So far today I have used the language translation features, bold, tinyurl, and map. In a way it reminds me a lot of Gnome-Do for linux in that it provides a quick way to get information but obviously ubiquity is much more powerful.

Monday, August 18, 2008

Waiting for Free iPhone SDK

What is this a Starbucks waiting line? Am I trying to download a microsoft product? Sure seems like it. Tonight I had a goal of getting my first Hello World app working for an iphone, but apple had other plans. While waiting for my turn in line to download the free SDK I watched the following video "Hello World Final SDK".

Saturday, August 9, 2008

Getting started with Grails and Extjs

This article describes how to get started using extjs with your grails app. Since the plugin is deprecated because of the GPL license fiasco, I decided to write my own simple grails script to handle installing extjs for the team for 2 main reasons:
1) Prevents me from having to commit 500+ files into SVN for every new version
2) Makes it easier to upgrade to newer versions of extjs in the future

We have 2 existing internal applications that use extjs and every upgrade I am kicking myself for not using maven to extract the extjs zip file. So with our new grails app I wanted to not make the same mistake.

Install Extjs
1) Download your choice of extjs. Note as of version 2.1 extjs is under the GPL license. Meaning if your project isn't open sourced under the GPL or an internal company app then you need to use the 2.0.x versions (2.0.2 is the latest). In our case I downloaded version 2.2.

2) Copy into your grails plugins directory

3) cd into your grails application

4) Add the zip file to svn (or whatever): svn add plugins/

5) run grails create-script install-extjs

6) Add the script to svn: svn add scripts/InstallExtjs.groovy

7) Modify the InstallExtjs.groovy script and add the following GANT code.

8) run grails install-extjs

9) Exclude the unziped ext directory: svn propedit svn:ignores web-app/js Exclude the folder ext.

Test it out
Now that you have extjs installed you can copy one of their examples into the grails web-app directory and update the links.

1) Open up the file again and extract the array-grid.html and array-grid.js files from the examples/grid folder to the grails web-app directory.

2) Modify the array-grid.html file. Update the relative links for css and javascript by replacing ../../ with js/ext/. For example, href="../../resources/css/ext-all.css", should now be href="js/ext/resources/css/ext-all.css"

3) Open up the array-grid.html file in your browser.

Now you have extjs installed with a simple example on how to use it. Next I would like to create a grails controller that returns JSON to populate a simple grid.