My development setup
It’s something I always wanted to write about and also a response to Peter Cooper’s post on RubyFlow calling to write about tools that we use everyday to do Ruby on Rails development. I like the idea since there are a lot of options and finding right tool for the job is essential.
Let’s start:
Hardware
- MacBook Pro 15″ with Intel Core 2 Duo 2.40GHz and 2 gigs of RAM - absolutely enough. This is a decent laptop, the only thing which bothers me is its temperature, sometime it burns my hands, literally…
- Logitech VX Nano Cordless Notebook Mouse – the best notebook mouse ever, has the smaller receiver out there + I change batteries like twice a year, love it
Base software
- Arch Linux – it’s my 6 day with this distro actually, I’m a Gentoo fanatic but from time to time I try to use something different. I usually go back to Gentoo after a month or so. We’ll see how I’ll end up now. So far I really like Arch, it’s extremely lightweight, fast and stable. Software availability is as good as in Gentoo. It’s also easy to make your own packages which is crucial for Ruby developers since it happens that we need various non-standard stuff, like let’s say Nginx with Passenger support. I’ve got a feeling that this time I won’t go back to Gentoo
- KDE – it’s my desktop environment and one of the most important reasons why I’ve switched back from OSX to Linux. KDE’s window manager is highly configurable and gives you features like moving and resizing of windows via a special key + mouse move/click, custom settings per application / window class so for instance you can configure that console window will always appear on the third virtual desktop snapped to the upper-right corner of the screen, useful desktop effects ie “Present windows” which is something like Expose in OSX but you can filter out windows by typing key words, cool window transparency (you can alt+mouse scroll to change window’s opacity…it’s useful, believe me) and much, much more…I just can’t work without those things. Here are KDE’s apps that I use:
- Konsole – terminal emulator, very powerful, has tabs, horizontal / vertical view splitting, bookmarks and fully customizable look’n'feel
- KRunner – something like quicksilver for OSX
- Dolphin – file manager, supports remote protocols, in my opinion the best file manager ever
- KDiff3 – GUI for displaying diffs and merging, it’s my mergetool in Git
- KColorEdit – color picker and editor
- KRuler – on-screen ruler
- KSnapshot – for doing screenshots
- Klipper – a handy clipboard manager, supports custom actions
- Amarok – music player
- NetBeans – I use this great IDE even for writing tiny scripts, for me it’s the best choice. I’ve tried many other IDEs/editors including Eclipse, JEdit, RubyMine, TextMate and others that I don’t remember now and NetBeans works best for me. Key features are powerful editor with macros and great shortcuts, ctrl+click navigation, fantastic JavaScript support, debugger, test/spec runner and…support for multiple projects in the same window, something that most of the IDEs don’t have and I really need it. I use following plugins:
- Firefox – I’ve switched from Opera a long time ago because of Firebug, now I’m about to try out Chromium for normal web browsing and use Firefox only for the development. Plugins that I find useful:
- Firebug – must-have for every web-developer
- Web Developer – easy access to things like clearing cache, disabling JavaScript etc.
- Chat Zilla – IRC
- Read it Later – I never have time to read interesting things from Google Reader in the moment I find them so…I read them later
- Delicious – I still use it but rather for sharing bookmarks between work and home
Dev tools:
- GIT - probably the best SCM in the world
- QGit4 – sometimes I use this git gui to view history of a project
- ZSH with a pimped prompt for GIT
- Nginx with Passanger – better then script/server
- VirtualBox – I have 3 Windows virtual machines each with different version of Internet Explorer, only for testing of course
Communication:
- Skype – Linux version is very crappy, unfortunately I’m forced to use it
- PSI - great Jabber client
- TweetDeck – powerful Twitter client, Adobe AIR based
That would be it!
Rack Middleware Contest
CodeRack is a coding contest dreamed up by a group of the Ruby programmers at Lunar Logic Polska who were excited about the possibilities of Rack middleware. The team wants to encourage Ruby developers to explore the possibilities and what better way than to hold a contest? The secondary goal of the contest is to generate a set of open source solutions that will solve real problems and inspire others. Every entry will be released under the MIT open source license.
Programmers are encouraged to submit contest entries that will be judged based on the cleverness of the application and the elegance of the code. Entries can be submitted at coderack.org until midnight EST November 15th. Finalists are scheduled to be announced on the 1st of December and public voting will run for one month. The final winners will be announced on the 5th of January.
The first round of the contest will be judged by an elite panel of judges including Ben Bangert of O’Reilly Media, Chris Wanstrath and PJ Hyett of GitHub, Joshua Peek of 37Signals, Yehuda Katz of Engine Yard and Rails core team member, Ryan Tomayko of Heroku, Core Rails team member Matt Aimonetti, and the Rails Envy team of Gregg Pollack and Jason Seifer.
Once the finalists have been selected by the panel, the public will vote for the top prize winners.
Prizes have been donated by Bytemark Hosting, GitHub, Jetbrains, Mindmeister, Freelance Total, Heroku, Rackspace Hosting, Peepcode, BDDCasts, and Zenbe Shareflow. The top prize includes a dedicated quad core server package and is valued at over $3000. Every entrant will receive a credit from bddcasts.com and $30 credit from Heroku. All finalists will receive a package including Zenbe Shareflow subscriptions, a RubyMine license from JetBrains, and five credits from bddcasts.com. Details of all of the prize packages will soon be available on the coderack.org website.
More information about the contest, including the contest rules, can be found at coderack.org.
ps. This post is a copy from Lunar Logic Polska blog
Unobtrusive JavaScript helpers in Rails 3
A while ago I have written a post about JavaScript helpers in Ruby on Rails and tried to explain why they are a bad idea. It’s hard to believe for me that it was almost 2 years ago! Since then so many things have happened in the Ruby world…Now Rails 3 is on its way and we already know what significant improvements and changes it will include. One of them is related to JavaScript helpers and the way how remote links and forms will be handled and I must admit that the new idea is absolutely great.
The new way is based on unobtrusive approach to JavaScript. This means that HTML code will be separated from JavaScript. I have checked out the latest sources of Ruby on Rails and found out that some of the work is already done. There is a new helper called AjaxHelper, it implements link_to_remote method which in the moment of writing this post looks like this:
def link_to_remote(name, url, options = {}) html = options.delete(:html) || {} update = options.delete(:update) if update.is_a?(Hash) html["data-update-success"] = update[:success] html["data-update-failure"] = update[:failure] else html["data-update-success"] = update end html["data-update-position"] = options.delete(:position) html["data-method"] = options.delete(:method) html["data-remote"] = "true" html.merge!(options) url = url_for(url) if url.is_a?(Hash) link_to(name, url, html) end |
What you see here will generate a clean markup with HTML5-compliant attributes prefixed with a word “data-”. If you are not familiar with them you can checkout a nice article by John Resig HTML 5 data- Attributes. Those attributes will instruct the additional JavaScript code how it should handle the behavior. Basically all links, buttons and forms that have the special attribute “data-remote” set to “true” will issue an AJAX request. There has been a discussion on the Rails on Rails Core group about how to implement corresponding JavaScript code. People are worried about its performance since finding all elements with data-remote=true appears to be slow in case of Prototype and jQuery. Moreover there is a problem of new elements that may be dynamically inserted after the page was loaded and all the event listeners were attached. Fortunately there is no need to be worried as our situation is a perfect example where we should use Event Delegation. DHH has already showed in his Rails 3 and the Real Secret to High Productivity presentation how links and buttons can be handled by Prototype library and it looks absolutely reasonable to me.
I would like to focus on jQuery though as it’s getting more popular even in the Rails community. Great example is my job where we use jQuery in every of our new projects. So how can we handle new remote links and forms using this popular library? Actually it’s ridiculously easy. Thanks to jQuery.live function we can easily use Event Delegation to handle AJAX calls. Just take a look at this sample of a markup that new helpers in Rails 3 will generate:
<!-- the new link to remote --> <a href="/users" data-remote="true">Users</a> <!-- the new remote form --> <form action="/users" method="post" data-remote="true"> <input type="text" name="login"/> <input type="submit"/> </form> |
Pretty clean, I really like it! Now let’s see how we can implement jQuery handler that will send AJAX requests:
var request = function(options) { $.ajax($.extend({ url : options.url, type : 'get' }, options)); return false; }; // remote links handler $('a[data-remote=true]').live('click', function() { return request({ url : this.href }); }); // remote forms handler $('form[data-remote=true]').live('submit', function() { return request({ url : this.action, type : this.method, data : $(this).serialize() }); }); |
The above code will send an AJAX request when you click on a remote link or submit a remote form. Note that it will work also with new elements dynamically inserted to the DOM. The example JavaScript code is the bare minimum of course, we could have something much more sophisticated. We will be able to specify success and failure handlers and also elements that should be updated with an AJAX response text (and probably much more!), hence the JavaScript is going to be more complicated.
This is definitely a step into the right direction. I’m looking forward to Rails 3!
Back From the Dead – a batch update
Wow, it’s been a while since I wrote last post. I guess I suck at writing posts on a regular basis. Hopefully I will be able to change that
So…a lot has happened recently and I’ve been quite busy. First of all about 3 months ago I bought my very own apartment. The whole process of getting a bank credit took 2 months and it was sucking my energy without any mercy. But…I did it and I’m alive
No more renting, I’ve got my own home. Me and the bank of course, haha.
Anyway now it’s time to get back to the Web and let people know what I’ve been working on.
Utype
At Lunar Logic Polska we’ve migrated our site to Utype which aims to be a modern, flexible, user and developer friendly CMS. It’s currently based on Merb and DataMapper. Our plan is to migrate it to Rails3 later this year. If you are interested in the development please have a look at the official GitHub repository
RubyTime
Again, at Lunar Logic Polska we’ve spent last couple of months working on a new version of our time tracking system. Version 3.1 will include some new features and many bug fixes. We should release it in July. You can see the progress at LightHouse site. The release will support external clients too – an iPhone app (by Kuba Suder) and a KDE4 plasmoid (by Marcin Kulik). RubyTime is an open source project, sources can be found at the official GitHub repository
DataMapper related goodies
That’s a fresh meat for me. I’ve resurrected a plugin that I’ve originally created to use with Utype and now after some hacking dm-is-configurable is compatible with DataMapper 0.10.0 RC1 and will be officially released whenever DataMapper 0.10 is finished, which should happen soon.
During my recent work for Ideeli I had to deal with Google Data API which I’ve found relatively simple to use via Ruby GData lib; however I would love to have even better way to access that API, hence I’ve created dm-gdata-adapters. The only thing that works there is loging in, but stay tuned! I’m going to write a wrapper around Spreadsheet API for a good start and hopefully I will find some people to help me with the rest of the APIs. If you are interested just drop me a line.
KDE4 related goodies
I’ve been experimenting with Plasma and trying to write a simple plasmoid (in Ruby or Python) which would replace Skype notifications. Current status is…double fail. I’m using an SVN snapshot of the upcoming KDE 4.3 and I’m having various issues with Ruby and Python bindings. pykde4 doesn’t work well with the Skype4Py library so I’m trying to use Ruby which seems to be unstable at the moment…oh well. We will see how it goes when KDE 4.3 RC1 is released (which will happen in a week
).
Me at Lunar Logic Polska
A couple of weeks ago I became responsible for implementing high standards of development at our company. We’ve created a list of various best practices that we’re following and now I’m one of the persons that make sure we’re really doing it. The process includes things like organizing regular code reviews, keeping track on the test coverage status for each of the projects that we’re working on, sharing knowledge between the teams etc…We will write a blog post on our site soon which will describe everything in detail as we believe it might be useful for other companies.
OK. Batch mode turned off. I’m glad I finally have the time (and energy) to write something here! G’nite
My sweet desktop environment – KDE 4.2 RC
About a month ago I installed Gentoo Linux on my MacBook Pro as I’ve become really disappointed with OSX. Being a linux user for a few years it’s hard to get used to such a limited operating system like OSX…Anyway I just want to show you some screenshots of a just released KDE 4.2 RC that is totally amazing…
Main Desktop Activity
This is where I work. I have two “Folder Views” with my Home and Downloads folders. There’s also a trash plasmoid, a big one so I can easily drop files there even when I’m drunk
Multimedia Activity
Here I have “Folder Views” of my Music and Video folders and a filtered Downloads “Folder View” where only multimedia files and folders are displayed. Those 2 icons in the upper-right corner are Amarok and SMPlayer shortcuts. Next to them is a “Now Playing” plasmoid. This is just the beginning of my Multimedia activity, but it’s already quite useful.
Tools Activity
When my Mac is on fire I go here to see the temperatures of the hardware, as well as the CPU load and system messages from the log file. I can also check out my disk usage. Oh, and there are also calendar, dictionary and calculator plasmoids.
File manager – Dolphin
I love this little yet powerful piece of an application. Dolphin is the best file manager I’ve ever used. It’s tiny, has all of the crucial features AND supports remote protocols. It also has “split view” which makes me so happy, that I don’t use Krusader (a twin panel file manager) anymore.
Music player – Amarok2
There are people whining about the new Amarok2. Personally I love it. Simplified playlist view, extended context view (with activity-like zooming!), fantastic collection browser and a decent integration with Last FM. I don’t need anything more.
Document viewer – Okular
Perfect for my needs and it doesn’t start 3 minutes like Adobe Reader.
Image viewer – Gwenview
Gwenview is terrible in KDE 3.x series, but in KDE4 it’s superior! It’s integrated with semantic desktop feature of KDE4 too so you can search and filter by tags and ratings.
Quick Access – KRunner
This is something like QuickSilver in OSX. I use KRunner to open applications or access files, but you can use it for many other tasks like calculations, spell checking, opening web bookmarks etc.
…it’s so good to use KDE again, I feel I can breath again.








