Diary of a Junior Ruby Developer

I was introduced to Ruby and Rails during the time I spent working for Manilla.com. Those were four really great months in my life that I  will never forget. Back then, working as a robot developer,  my goal was to slowly acquire  the skills that would allow me to eventually move into the Rails team.  Sadly, Manilla closed its doors before I could get a chance to achieve that goal.

Shortly after Manilla closed, I found another job working remotely for a company that provides enterprise publishing solutions. I was hired as a Junior Ruby on Rails Developer and now I work  mostly troubleshooting, fixing bugs and occasionally implementing customers requests. The job is challenging because tickets are hardly ever about the same issue and there’s so much to learn about their codebase and, in the process, about Rails and Ruby, as well.  I am very fortunate that there’s plenty of knowledge to go around and the other members of the team are always happy to help you or at least point you in the right direction. I love peer reviews! It’s a great way to learn from others that have been writing code longer than you and have tons of tricks under their sleeve. Still, learning takes time.ah728

It’s like drinking from a fire hose. That’s the analogy our CTO used recently when talking about the sheer amount of information that gets dumped on you during your first days or weeks on the job. It gets better with time. I do my part by reading everything Ruby or Rails that falls in my hands, watching videos, following tutorials, etc. As a matter of fact,  I am incredibly lucky I finished reading  ‘Everyday Rails Testing with RSpec’  just in time to put all those newly acquired testing skills to good use on my first week on the job.  I highly recommend that book! The railscasts have been a great help, as well, but there’s plenty that can only be learned while on the job. Nothing beats that kind of experience.

Perhaps, my next update will find me a lot more confident. For now, I’m enjoying the job, because this is what I wanted to do and every step is getting me closer and closer to where I want to be someday, but I am also  in “survival mode”, spending most of my spare time trying to learn more and learn faster.

 

Packt’s 10 year anniversary means $10.00 books and videos!

One more time, my favorite IT book publisher is having a fantastic sale. This time, Packt Publishing is celebrating 10 years of providing great learning and information materials for IT professionals. According to their press release, during that time Packt has published over 2000 titles and helped projects become household names, awarding over $400,000 through its Open Source Project Royalty Scheme.

To celebrate this milestone, Packt is offering all their books and videos for only $10.00 each. There’s no limit how many books or videos you can purchase from them, but this offer will only last until July 5th.

[...]

Celebrate Day Against DRM with Packt!

I just heard news of Packt’s Day Against DRM (#DayAgainstDRM) that will take place on May 6th 2014, and wanted to share the good news with you. For 24 hours, all of Packt’s ebooks and videos will be only $10.00 each. This is a great opportunity to stock up on their most popular and/or newest titles!

According to the definition of DRM on Wikipedia, Digital Rights Management (DRM) is a class of technologies that are used by hardware manufacturers, publishers, copyright holders, and individuals with the intent to control the use of digital content and devices after sale.

However, Packt [...]

Packtpub is celebrating their 2000th title with a BOGO sale!

I love Packtpub books! I just had to spread the word about their milestone sale as it is a great opportunity for packtpub books lovers everywhere to acquire a few more titles. Hurry! The sale is for a limited time! :-)

 

Known for their extensive range of pragmatic IT ebooks, Packt Publishing are celebrating their 2000th book title `Learning Dart’– they want their customers to celebrate too.

To mark this milestone Packt Publishing will launch a ‘Buy One Get One Free’ offer across all eBooks on March 18th – for a limited period only.

Packt is one of the [...]

Accessing a Private Method for Testing

Sometimes, I come across a private method in one of the models that I really need to test. Rather than try to change the way the model is written, I’ve found a way around this limitation using ReflectionMethod.

Suppose we have a class with a private method such as this one:

class MyClass { private function myPrivateMethod( $some_value){ $new_value = $some_value + 5; return $new_value; } }

Granted, that is a very silly method, but is only meant as an easy example. In order to be able to test this method, we can do the following:

$testMethod = new ReflectionMethod('MyClass', [...]

Quick Tip: Sorting arrays with array_multisort

Sometimes you need to sort an associative array in more than one way. Let’s say you have an array such as this one, representing the toys inside a toy box. The keys are the name of the toy and the values are how many of each we have:

$items = array( "balls" => 5, "toy cars" => 1, "ropes" => 5, "dolls" => 3, "jumping jacks" => 5, "tea sets" => 2 );

And you need to sort this array in order to print a list displaying the toys of which we have the most showing up first. Those toys [...]

Quick Tip: MySQL Subqueries

This is a little tip that a co-worker shared with me some time ago and has made my life so much easier. I am often faced with a situation very similar to this: let’s say we have a table called users_rooms that includes the columns user, room, deleted, created and modified. I am required to insert new rows in this table where the values of the room column for user 123 should match all the available ones for the same column for user 128. This is something easy to do with subqueries, like this:

"insert into users_rooms (user, room, created, [...]

Moving and Deleting messages with PHP IMAP

PHP provides a great deal of functions to operate with the IMAP protocol, but implementing them isn’t always so straightforward. For example, how to best mark multiple messages as read or unread, move them to a different folder or mark them as deleted without running into a situation where some of them “return” to your inbox next time you sync to the account or worse, you end up marking as deleted other messages you did not intend to. This is actually a real-life issue we ran into at work.

Given a sequence of messages, you have a message number and [...]

Advanced Web Application Development with Express

A few days ago, I was given a copy of the book Advanced Express Web Application Development from Packtpub to review it and I’m pleased because it is a really good book. As I mentioned before, I got interested in Node.js because I learned that it could be used to do testing on the UI, which is one of the most difficult things to do for us at work right now, giving the ever changing nature of our application.

Although not completely unfamiliar, I am a newbie when it comes to Node.js, Express and related technologies. I have read my [...]

What I’m reading this month

What started as curiosity over better ways to test in the UI has become a great interest in developing web applications using Node.js and Express.js. I’ve already gone through my share of tutorials and examples, and this month I was also lucky enough to be given the opportunity to review a new Express.js book by Packtpub.com. The book is called Advanced Express Web Development. It looks good so far. I will be posting a review here very soon. In the meantime, if you are interested, you can get it from Packt here: http://www.packtpub.com/advanced-express-web-application-development/book