Browsing articles in "Groovy"
Apr
22

More on “Where next for Grails”? • GRAILS.IO

By Rob Warner  //  Development, Grails, Groovy, SaaS, Software  //  No Comments

More on “Where next for Grails”? • GRAILS.IO: “Grails 3.0 will be a reinvention of the framework that you love, and we will be making some hard decisions about what we support in terms of backwards compatibility. With Grails 3.0 we plan to allow the creation of applications in different architectural styles. Servlet API applications will always be supported, but we plan to make ‘create-app’ extensible, so that Grails can be used to create a range of types of applications (Batch, NIO, Netty, ‘static void main’ etc.).”

I saw this link in a tweet from @jeffscottbrown, and it points to the impact JavaScript is making on web development, whether with rich client apps or node.js on the server. Better to see them acknowledge and embrace the shift.

I did some Grails work a few years ago, and really liked it. Reading this post made me realize I miss doing Grails and Groovy–I’ll have to find an excuse to get back to them!

BTW, however much this domain’s name seems to derive from Grails, I’d never heard of Grails when I registered grailbox.com in August of 2006. Some web poking reveals that work on Grails got underway in 2005, but I didn’t hear about it until much later. My vision for grailbox focused on office productivity tools: (holy) grail + mailbox. I guess I haven’t done much on that front, though!

Sep
1

How to Set Up a New MacBook Pro for Development

By Rob Warner  //  Development, Grails, Groovy, iOS, Java, Rails, Ruby  //  5 Comments

I recently purchased a MacBook Pro and got a new MacBook Pro at work, so I had two machines to set up. Here are the steps I went through to make these machines tuned for developing iOS applications as well as doing Java, Ruby, and Groovy development. I’d love to hear feedback on things I missed, things you don’t agree with, or things that didn’t work for you.

Special thanks to Rogelio Samour, aka Ro, (@therubymug) and the rest of the folks at Hashrocket for sharing their setup steps for setting up a MacBook Pro for Rails development.

Starting Out — Basic Configuration

These are the basic items that, regardless of the languages you plan to develop in, you should do.

  • Boot the machine, create your user, and use Software Update to download and install all updates.
  • Go to System Preferences –> Keyboard, and on the Keyboard tab slide Key Repeat Rate all the way to the right. Check the box for “Use all F1, F2 . . . .” Click the Modifier Keys button and change Caps Lock Key to Control. Select the Keyboard Shortcuts tab and select “All controls” for Full Keyboard Access.
  • In System Preferences –> Expose & Spaces –> Spaces, check Enable Spaces and Show Spaces in menu bar. Reconfigure for 1 row, 4 columns.
  • Install TextExpander. Launch it and go to File –> Add Predefined Group and choose CSS Snippets, HTML snippets, and TIDBITS Autocorrect Dictionary.
  • Drag everything you can out of the Dock, make it really small, auto-hide it, and put it on the left side.

Launcher

You need a launcher. I used to use QuickSilver, and I always read that you can do so many powerful things with it beyond simply launching applications. I always meant to learn what those things are, but I never have and realize that I never will. I’ve been tempted to buy LaunchBar or F10 Launch Studio, but I fear I’d never learn the extra features and just use these apps to launch applications, and I can do that for free with Namely. Install it and go into its settings to map it to Ctrl+J.

Terminal

I used to use iTerm for its tabbed windows, but OS X’s Terminal finally got tabs. You want a terminal window at your fingertips at all times, though, so install Visor, which is a dropdown, Quake-style terminal. Follow the installation instructions, installing SIMBL first then dropping the Visor bundle in the appropriate directory, and then map Visor to Ctrl+L and select its “Copy on Select” checkbox. Launch System Preferences –> Accounts –> (Your Account) –> Login Items and add Namely and Terminal. (Note: Namely has a preference to Open on Login, but that didn’t work for me).

File Backup and Sharing

Install Dropbox and either log in or register for an account. Be sure to enable Growl notifications during the installation.

Window Management

The Rocketeers at Hashrocket use SizeUp to manage windows via the keyboard, and the same company offers a mouse-driven version called Cinch. I like Divvy, though. Install it, map it to Ctrl+K, and select to start at login. Create 4 shortcuts: Left 50% (A), Right 50% (S), Top 50% (D), and Bottom 50% (F).

General Development + iOS and Mac Development

  • Create a directory in your home folder called Development. This is where all your development projects will live.
  • Go to Finder and drag the Development and Downloads folders to the left side under Places.
  • Install the latest Xcode. As of this writing, that’s Xcode 3, and Xcode 4 is available as a Developer Preview. Install both. Note: you must install Xcode, even if you don’t plan to write iOS or Mac apps, so that you can compile things like rubygems.
  • Install Accessorizer and configure it according to its quick-start guide.

Text Editor

No direction here will spark more controversy than this one, so install the editor you like best. If you’re smart, though, you’ll install MacVim, and not just because it’s free (I’ve bought licenses to and used BBEdit and TextMate). Wait to configure MacVim in the Ruby + Dotfiles section.

Ruby + Dotfiles (Don’t Skip!)

Rogelio Samour from Hashrocket has written an excellent blog post on how to set up a Ruby and Rails development environment at http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html. The instructions include steps specific to ruby and rails, but also steps for setting up your editor and dotfiles. Follow his instructions and ignore the ruby stuff if you don’t do ruby (though you should!). Note: here are my deviations from that page:

  • Didn’t install SizeUp (I like Divvy better) or Teleport (I’m not pair programming in a shared-computer environment).
  • Didn’t use Homebrew to install MacVim, but instead downloaded and installed from http://code.google.com/p/macvim/. I put the MacVim bundle in /Applications and the mvim command line in /usr/local/bin.
  • Didn’t install RubyCocoa–I don’t use Rspactor, and I read that the latest version doesn’t require it anyway.
  • Didn’t install Growl–Dropbox already did.
  • Unless Ro has fixed it, he has a line that says to type rvm gemset use 1.8.7@global. That gives you an error. Instead, type rvm use 1.8.7@global. Thanks to Big Tiger (@jremsikjr) and Sandro (@sandrot) for figuring this out for me!

After you finish Ro’s instructions, do the following:

  • Run this: echo ‘:colorscheme vividchalk’ > ~/.gvimrc
  • Put this in ~/.vimrc.local:
    set tabstop=2
    set smarttab
    set shiftwidth=2
    set autoindent
    set expandtab
    set number
    set directory=/tmp
    set laststatus=2
    set scrolloff=3
    set guioptions-=r
    set guioptions-=T
    

    Some of these are redundant with the Hashrocket settings, but in case they change theirs . . . .

  • Put this in ~/.gitconfig:
    [push]
    	default = current
    [user]
    	name = (Your Name)
    	email = (Your Email Address)
    [color]
    	diff = auto
    	status = auto
    	branch = auto
    	interactive = auto
    [core]
    	excludesfile = /Users/(Your User ID)/.gitignore
    

    Replace the parenthetical expressions appropriately

  • Put this in ~/.gitignore:
    .DS_Store
    *.swp
    

Java

Install Eclipse Helios from http://eclipse.org. It’s still the best Java IDE out there.

Groovy/Grails

Follow these steps to install Groovy and Grails development tools:

  • mkdir /opt
  • Install the latest Groovy from http://groovy.codehaus.org into /opt
  • cd /opt && ln -s groovy-1.7.4/ groovy
  • Install the latest Grails from http://grails.org into /opt
  • cd /opt && ln -s grails-1.3.4/ grails
  • Put in ~/.bashrc.local:
    export GROOVY_HOME=/opt/groovy
    export GRAILS_HOME=/opt/grails
    export PATH=$PATH:$GROOVY_HOME/bin
    
  • Install NetBeans. Yes, you could use MacVim or Eclipse for Groovy/Grails, but this is my setup and this is the way I like it. Another excellent choice is SpringSource Tool Suite.
  • Launch NetBeans, create a new Groovy/Grails Application in ~/Development, and click the Configure Grails button. In the dialog, click the Groovy tab, and put /opt/grails for Grails Home.
  • Browsers

    If you followed Ro’s instructions above, you’ve already installed Chrome and Firefox. If not, install them now. Launch Firefox and install the following extensions:

    • Firebug
    • Live HTTP headers
    • Omnibar
    • View Source Chart
    • Web Developer

    Open Safari preferences, go to the Tabs tab, and for “Open pages in tabs instead of windows” select Automatically.

    Notes

    I’ve used Soho Notes and DEVONthink, but Evernote works across platforms, including iPhone and iPad, and keeps all the notes in sync. You can also access your notes from a browser. Anywhere you go, you can take and access your notes.

    Twitter

    I tried not to use TweetDeck so I wouldn’t have to install Adobe AIR, but Balsamiq Mockups (below) requires AIR and I can’t find a Twitter client I like better than TweetDeck anyway. After you install TweetDeck, though, go into its preferences and turn off notifications (both detail and summary). You have work to do.

    Instant Messaging

    I used to use Adium, but iChat is already installed on your Mac and supports Google Talk, Facebook (through Jabber), and any other Jabber services. Configure iChat but be sure to turn off the sounds for buddies logging on or off.

    Finder Replacement

    I know of no reasonable competition to Path Finder. Install it and turn on its dual panes.

    FTP

    Cyberduck is free, as is Fugu, but Transmit is worth the money.

    Graphics

    If you’re a designer, you’ll purchase and install the Adobe Creative Suite. If not, you probably shouldn’t spend the money. Go with GIMP and Inkscape.

    Mockups

    Install Balsamiq Mockups for doing mockups of web pages, client apps, iPhone apps, iOS apps, or whatever you need to mock up. Money well spent.

    Screen Captures

    Mac OS X comes with built-in screen capture capability, but Snapz Pro X does so much more, including video capture.

    Blogging

    I like to use a desktop client for blogging — it makes me feel safer, as I’ve lost plenty of text in my time to fickle web pages. I really can’t tell a difference between MarsEdit and ecto, at least the way I use them, so I went with ecto because it’s cheaper.

    Office

    I’m sure OpenOffice is sufficient for most developers, but I have to use certain Word templates for work and writing, and create PowerPoint presentations for external consumption, that it’s not worth fighting any inconsistencies. Besides, I need Entourage for work. The work computer got MS Office Professional and my personal computer got MS Office Home. For the personal computer, I also had iWork pre-installed. Consider it my mini-protest. I’ll probably end up installing OpenOffice as well, in case someone sends me any .odt files (I don’t think Word can read those yet), but I’m holding off for awhile.

    Utility

    Install AppZapper so you don’t litter your disk with unused .plist files.

    Passwords

    I’ve used several password managers, but I figured out some time ago that I want a command line tool so I wrote one in Ruby. To install, press Ctrl+L to drop down Visor and type:

    • rvm use 1.8.7@global
    • gem install safe
    • echo ‘export SAFE_DIR=~/Dropbox’ >> ~/.bashrc.local

    Note: when I ran this on one machine, gem install complained that it couldn’t find the crypt gem. I ran gem install crypt and then gem install safe. On the other machine, gem install safe worked fine. YMMV.

    You can read about safe, including how to use it, at http://grailbox.com/safe/. It’s beta software, use at your own risk, etc. I’ve been using it since 2007, though. Note that putting your safe file on Dropbox lets you run safe from all your machines, and it backs up (and versions) your safe file.

    Web Site Development

    I’ve looked at Coda, and I got a license to Espresso through one of the MacHeist deals, but I really haven’t figured out when I’ll use these. I want to, though, so my one concession to installing software on these machines that I don’t really use was Espresso. I’m going to make myself use it, and maybe then I’ll see the value.

    What Did I Leave Out?

    I’m such a software junkie that I install far more software than I use, so I disciplined myself to install only software that I’m currently using. Some software just barely missed the cut:

    Conclusion

    I’m still on week 1 of using these machines, and I’m sure I’ve missed plenty. These setup instructions, however, provide a rock-solid working environment. You may disagree with some of my choices — in fact, I hope you do, so I can find more software that other people are using to solve real problems. Don’t bother, though, to try to talk me into Emacs ;-)

    Update: 9/4/2010

    I’ve added the following software this past week:

    Update: 9/6/2010

    I’ve added some more software:

    • I had some EPS files that I needed to resize and export to PNG. Inkscape, GIMP, and Preview proved inadequate, so I installed Pixelmator, which worked perfectly.
    • I remembered DiffMerge from SourceGear. I always pay attention to what Eric Sink is up to, because he’s both bright and funny, so I installed that as well.

    Update: 9/21/2010

    After reading this post on vim configuration, I can’t believe I’ve been navigating split windows with j, etc. I mapped the Control+direction keys (h, j, k, l) to , as suggested in the article, which meant I had to move Namely, Divvy, and Visor. I moved them to Ctrl+q, Ctrl+w, and Ctrl+e, respectively. I wonder how long it will take for my muscle memory to update, and I hope I don’t discover any collisions.

    Recent Tweets

    • The RSS feed for this twitter account is not loadable for the moment.

    Follow @hoop33 on twitter.

    What I’m Writing

    Pro Core Data for iOS — co-authored with Michael Privat. Click the "Buy from Amazon" button to order!
     
    Beginning Mac OS X Lion Apps Development — co-authoring with Michael Privat. Click the "Buy from Amazon" button to pre-order!