Rails in a week - day 7

              ·

Today was the last day of my Rails week. I added some database-backing to my app (with a fully scaffolded model and all!) for the countries’ data and refactored a fair bit, though I’m still unsure about a few decisions I made, such as if I should put the base data in seeds.rb or in a migration. Oh, well. The website is available here: http://antipodes.plui.es And its source code is on GitHub.


Rails in a week - day 6

              ·

TL;DR: testing works, I learned i18n, and fixed a bug through TDD. After writing a simple little functional test and making it run through rake test, albeit slowly, I installed Spork and autotest. From what I gathered, Spork is an RSpec-only thing, so I wrote a few RSpec tests instead of functional tests. After a bit of tweaking, everything was going smoothly between Spork and autotest, all running RSpec, but my file in test/ was ignored.


Rails in a week - day 5

              ·

TL;DR: polishing. Trying to get into TDD, but slowness makes it a strange experience. This “day 5” has been more or less spread over two days because of other engagements (mowing the lawn and subscribing an insurance policy for abroad if you wish to know the details), and I didn’t keep precise tracks of the steps I took. The major milestone is that the MVP for Antipodes is online at http://antipodes.


Rails in a week - day 4

              ·

TL;DR: it deploys! Finally! After a full day spend battling cryptic error messages, I finally got my 10-lines Rails app to deploy. First thing in the morning, I decided to switch to using rvm on my production machine too, in order to have the same setup and version on Ruby (1.9.2) for testing and production. This meant also reinstalling the important gems (bundler, rails, rake). The production machine uses nginx+Passenger, which I reinstalled (following instructions here) in order to work smoothly with this now rvm-ed ruby.


Rails in a week - day 3

              ·

TL;DR: phew. Deployment is hard. Testing is slow. Morning: off due to World Cup; watching of the match against New Zealand. :( Afternoon: while playing a bit more with the prototype, I noticed the logic is actually broken and my way to calculate an antipode was actually broken. This came from the fact that the longitude and latitude coordinates aren’t logically the same. Latitude divides the globe on its equator while longitude is arbitrarily positioned… I guess?


Rails in a week - day 2

              ·

TL;DR: I have a terribly ugly first draft of the application working! Morning: spent finishing reading the Getting Started guide and beginning the Rails Tutorial. Afternoon: so, let’s get down to maps… What’s cool in Rails is that there are plenty of gems, and you just have to plug them in, right? GoogleMapsForRails seems like the right tool for the job. After trying to get my posts to be geolocalized… Success!


Rails in a week - day 1

              ·

TL;DR: I began learning Rails this morning, and even though Rails in itself is (seems?) easy enough, setting everything up and deploying is hairier. 8:00: let’s get started! First step: getting vagrant up and running. We’ll hit the tutorial. 8:15: the lucid32 “box”, Vagrant’s parlance for a virtual machine image, is downloading. Time to get a cup of coffee. 8:40: box downloaded, let’s get on with the VM setup process. vagrant ssh… Yep, it works!


Rails in a week - day 0

              ·

Tl;dr: I’m learning Rails in a week! And I’ll blog about it all along. Any tips? So. Learning Rails. As a recent graduate in CS, moving to a new country in two weeks and looking forward to expand my skills, Rails looks like a good fit: it’s in demand, it focuses on developer happiness, vibrant ecosystem yadda yadda. You probably already know this so let’s cut the marketing speak!


An interesting CSS hack for highlighting S-expressions

              ·

The Community-Scheme-Wiki has a pretty interesting way of highlighting lispy code Scheme being a Lisp dialect, it makes sense to highlight the S-expressions, i.e. “things between parenthesis”. The Community Scheme Wiki does exactly that. As you move your mouse over the code, it will highlight the s-expression you’re in and the ones around in different colors, allowing you to quickly make sense of the code. An example can be found on this page, which renders like this as you move your mouse:


So you want to do the SICP...

        

That’s awesome! But maybe you don’t know where to start. So here we go! Wait, the what? Structure and Interpretation of Computer Programs, a.k.a. the SICP, is an MIT class teaching computer languages turned into a book. Why should you care? I’ll let Stack Overflow answer: Some classics [...] teach you the effective working habits and the painstaking details of the trade. Others [...] delve into the psychosocial aspects of software development.