5 Misc. Rails Tips

Just a quick note before I start - This has been written mainly as an entry to the Railscast's contest for epic loot. With that said, I'm hoping they're some generally helpful tips.

Tip #1 - Join the community

The most important part of Rails is the community - the fantastic little groups thats pop up focused on individual niches. You've probably seen WorkingWithRails and the like but my suggestion is that as a Rails / Ruby-based developer, it's usually in your best interested to partake in the community. And even more so, not just the communities for your specific niche - read up about alternatives (e.g. Merb), hang out in irc rooms and most of all participate. For Rubyists, I recommend the following:

  • User Groups: Join your local user groups; In Perth we have AWIA / Port80 (which is Web Developers in General) and RORO - both of which are an invaluable source of knowledge and a great bunch of people. Also, most will put on talks or events of some kind (RORO over east has Railscamps which are damned awesome looking) and so you'll also get plenty of opportunities to network and to learn more.
  • Forums / Mailing Lists: I'm not into forums as much as I used to but both Forms (e.g. RailsForum) and Mailing Lists (e.g. the official Ruby On Rails one etc) are a fantastic place to both read news and to keep up to date. An even better way of building your knowledge is to be on the bleeding edge and Mailing Lists in particular (along with IRC) are the perfect places to find out what people are making.
  • IRC: I can't stress this enough - Hanging out on IRC is a great way to meet people in your community, to find out what is happening and to just learn. Freenode seems to be the hip place these days and I suggest checking out #rubyonrails, #merb, #datamapper, #roro (if you're Australian) and #offrails - The last one is less formal than the others but is in general a small community of usually-rails-based developers.
  • Twitter: Lastly, Twitter is the new irc. My only suggestion here is to sign up if you haven't a follow a few different Ruby / Rails developers. There is a lot of noise but there is also a lot of new stuff.

Tip #2 - Have a testing server

When I say testing server, I don't mean one dedicated to running unit tests; I mean one for you to test out little ideas - even if there is a possibility they could bork your environment. VM's are ideal for this and VirtualBox is both free, easy and available on most major platforms. It can be as simple as downloading VirtualBox, an Ubuntu ISO and then setting it up like a real environment - all safely nestled away on your development box if you'd like.

If you want to go a bit further and you have a spare box sitting around, setup Vmware Server or Xen and a few different vm's with different environments - In particular, a Continuous Integration box may come in handy and I've always like the idea of having my own gem server which builds gems for the edge versions of Merb, Rails and the Like so my system is always up to date. It shouldn't take more than a day or two to setup and if you don't have much server experience, it's the perfect excuse to learn.

Tip #3 - Check out new technology

Try and stay on the cutting edge of things - e.g. become one of the early adopters of a technology (e.g. Merb / Git are examples of that a while ago - they're pretty much mainstream now). The technology / project you choose may not become mainstream but you'll learn a hell of a lot you likely wouldn't of before - I learnt a lot about ruby by reading through the source of early versions of Merb.

Also, contributing back to new technologies is usually a good way of getting to know people (see above) and it's also another way of getting respect among other developers.

Tip #4 - Have a pet application

Even if you're only doing Rails for work, I suggest having a little pet application at home to experiment with stuff. It may not be used by others but it's an excellent way of trying out new things, building your skills and honestly, who knows - you could have the next github on your hands.

More seriously, by building a pet application you get to not only focus on something at your own pace but it also lets you put into practice things that may only be applicable in certain circumstances in the real world as well as having the freedom to test out plugins etc as you see fit.

Tip #4 / #5 - Do RailsRumble

This one is more specific than the others but it's for a reason - I highly suggest taking part in the next RailsRumble when the times comes around. It's not only a bloody good time but if you get a team together it's an excellent environment in which to show off your development skills.

The main reason I'm suggesting this is because it ties together everything I've already suggested - It lets you work in a real world situation (e.g. time based), it lets your form invaluable connections (I only now frequent #offrails because of RailsRumble) and there's even some nice motivation for taking part.


Well, there you have it - My main 5 tips for Rails developers; All of them intended more at being a better developer than developing better (if that makes sense)

Posted by in Programming and it's been tagged as rails, ror, programming & railscasts. There are currently zero comments.


Rack::URLMap and kicking ass.

Rack come's with a lot of excellent middleware out of the box, making a lot of seriously cool things possible. One of the most important of these middleware's is URLMap - a little gem that lets you map different url paths to different rack applications. Using Rack::Builder / rackup syntax you can use the map method with a block to define a different urled application.

(Please view full post for more.)

Posted by in Programming and it's been tagged as rack, ruby, programming & urlmap. There are currently zero comments.


Busting a cap in yo' ass!

Ok, the titles lame but I hope the contents aren't. Today I'll be running through a quick Capistrano config - perfect for if your running on a VPS - that has a heap of free goodies included. Also, thanks to Skiz on #offrails for a nice start earlier after I lost some of my stuff.

(Please view full post for more.)

Posted by in Programming and it's been tagged as programming, rails, deployment, ruby & capistrano. There are currently 2 comments.


Now extra thin!

And in other news, I upgraded the blog to Thin tonight. The extra speed and power was a nice incentive to switch as was the whole 'coolness factor'. Next up is rewriting the stats server. So +1 Kudos for thin!.

Posted by in Programming and it's been tagged as blog, rails, server & programming. There are currently 1 comments.


Erlang & Project Euler

Just a quick and fairly simple post. I've been reading Programming Erlang over the last few days and decided tonight to have a quick play with the Project Euler problems (having never done them before). Here ~10 minutes work :)

%% Erlang Solution to Project Euler Problem #2 %% "Sum of all even primes under one million" %% Written by Darcy Laycock %% http://blog.ninjahideout.com/ -module(pe). -compile(export_all). start() -> process(1000000). process(Max) -> io:format("Calculating All Even Fib. Under ~p~n", [Max]), evenFactorialsUnder(1, 1, Max, 0). printResults(0) -> io:format("No Known Results.~n"); printResults(Results) -> io:format("Found Result:~n~p~n", [Results]). evenFactorialsUnder(A, B, Max, Acc) when A+B > Max -> printResults(Acc); evenFactorialsUnder(A, B, Max, Acc) -> NewNum = A + B, case NewNum rem 2 of 0 -> %% even evenFactorialsUnder(NewNum, A, Max, Acc + NewNum); 1 -> %% odd evenFactorialsUnder(NewNum, A, Max, Acc) end.

Edit: More of these coming tonight :) Simple but fun!

Posted by in Programming and it's been tagged as erlang, programming, problem & maths. There are currently zero comments.


b0rked images

So I made it big mistake tonight. It wasn't on purpose - far from it in fact. I was editing the deploy.rb I use to put it on this blog (thank god for Capistrano) to upload some small admin-side fixes. I decided to also make a small change that would make the symbolic linking process for image directories work. Except, I got the wrong directory. I accidentally typed in the shortcut / variable for the actual (non linked) directory to the rm part of the routine. And so, now they're gone. You'll have to just ignore the lack of images for the moment till sometime after the twelfth when I can restore them.

Posted by in General and it's been tagged as blog, programming, b0rked, error & stupidity. There are currently zero comments.


Eoraptor's future

Since its first inception a few months ago as a merb blogging platform (I'm now running on Rails 2.0), I've always had the aim of releasing Eoraptor (the software that powers this blog) under an open source license. The platform still has its kinks (as you are no doubt aware) but I'm planning on releasing it as open source once I've finished a couple of items off. Primarily,

  1. Spec's for the entire site - I've been pretty lazy so far in this regard
  2. Twitter / Tumblr / Pownce like integration - I'd ideally like a flow-of-thoughts style front page
  3. Finish off the projects section - it's currently part done but disabled on this blog.
  4. A settings page - to make it easier to administrate

I guess once all of them have been covered, I'll finally release it. For the moment, consider this more as a road map.

Posted by in Programming and it's been tagged as eoraptor, blog, rails & programming. There are currently zero comments.


Learning Languages

As a programmer, one of the things I enjoy the most is the structure of languages - how inherently different styling can mould the experience I have when learning it. As an offshoot of this, I've slowly become interested in different programming languages and how they can be used in everyday life.

(Please view full post for more.)

Posted by in Programming and it's been tagged as programming, languages, erlang & haskell. There are currently zero comments.


Commenting == Fixed

I only realised earlier tonight that I'd made a big boo-boo with the blog - commenting required you to be logged in, something which was restricted to Admin users. So, I've since fixed that (as well as a few bugs you likely wouldn't have seen before) and all seems to be working well know.

Posted by in Programming and it's been tagged as blog, programming & fixes. There are currently 1 comments.


The road to ATM

For the last year or so, I've been planning on launching a new project - something different to what I've worked on (e.g. this blog) with commercial viability. In other words, I've dreamt of working on a startup-style company (A dream I actually achieved in late 2007 when I joined the WhyGoSolo team) with the aim of launching something I think would be pretty damn cool.

(Please view full post for more.)

Posted by in Programming and it's been tagged as programming, atm, series, ninjas & ruby on rails. There are currently zero comments.