Saturday, April 13, 2013

Factory Girl & after_initialize

If you're using Factory Girl with your RSpec tests and you are using the after_initialize callback, you might be wondering why your tests aren't passing, and then come to realize that the after_initialize callback event is never triggering. Luckily, there's a simple fix. Be sure to add something like this...

after(:build) {|instanace| instance.after_initialize_callback_method }

inside of your factory.

Sunday, March 31, 2013

Learning Resource from Ex-Boot at DBC

Even though Dev Bootcamp has been a great resource for learning, most people still learn best by repetition, and to that end I present you, and leave for myself, the following online resource...

which is essentially 'cliff's notes' for web developers.

Jeopary Live @ DBC

I've been attending Dev Bootcamp for the past 6 weeks, and I haven't written a single blog post. So, without further ado, here's my first...

One particular assignment at DBC was to create a flash-card-like game, and in response, myself and 3 of my fellow 'boots' came up with the following...

Special shout out to Matthew, for informing me about the long list of Jeopardy question we ended up using, and especially Ryan for obtaining them originally.

Tuesday, October 9, 2012

Brewing mySQL 5.5

If you're installing mySQL with Brew, there are a few additional tasks you'll want to complete before you can start the server.

1. Run...

$ mysql_install_db

from the installation directory.

2. Make a mysql dir inside /etc/

$ sudo mkdir /etc/mysql

3. Create a mysql config file inside your new mysql directory...

$ sudo vim /etc/mysql/my.cnf

and set the base directory of your mysql install by adding the following text to the .cnf file:


Thursday, August 9, 2012

Searching for a Rails job

I was a Flash Dev for 6 years.  I've been a Front-End Dev for 4 months, working mostly with CSS & Javascript. I'm an aspiring Rails Dev, and have been through about a dozen phone interviews, and 1 in office interview, for a Rails position. I've also asked a lot questions to friends of mine who are experienced Rails Devs, about what to learn, what to build, and what to expect in the job hunt.

The first set of advice I got, was to make a Rails application, and another, and another. Get familiar with Rails, by doing. Post your code to Github, so others can see what you've done. And if possible, get people using what you've made.

The second round of advice given to me, was to contribute to the open source community. Find a project that interests you, and use it. Look for bugs, or potential features, and fix/add them. Github is a great place for this, because you can simply browse through already known issues, and submit a fix straight to the project admin.

A few friends of mine, who actually interview Rails candidates, say they look for people who can think pragmatically. They sometimes ask questions like, "How many cars are currently in San Francisco?", or "Write a program that would tell me what people are currently twittering most about, today?" And while you can't know how many cars are in San Francisco, you can make educated guesses about how cars exist within the average city block, and how many blocks are in San Francisco, etc, etc. As for the Twitter question, they're looking to see if you know how to store and retrieve data and perform a simple search. If you can get past that, and you might be surprised how many people can't, they'll dig a little more into space & time efficiency, and when to use what technology. You probably won't be able to answer every question they throw at you, but that should be okay. HINT: Research algorithmic complexity (aka: Big O)

As for my personal experiences during interviews, the questions I've been asked haven't been quite as generalize as the ones my cohorts posed. Usually I've been asked very specific questions about Rails-related terms and methodologies, and basic programming concepts. The #1 question that keeps popping up, what's the difference between "==" and "===". A few more common questions include...

"What's the difference between private, protected, and public?" 
"What does REGEX stand for, and what is it?"
"Define the various terms, class, object, method?"
"What does MVC stand for?"
"What does DRY stand for?"
"What is an iterator?"

"Describe some of the HTML5 tags?"
"What does ORM stand for?"
"What's the difference between attr_accessor and attr_accessible?"
"What are the various model relationships assignments in ActiveRecord?"
"Describe how to build a has_many, and belong_to_many model relationship."
"What are the various model validations in Rails?"
"What's a hash, and how do you add/remove values from it?"
"What's the difference between extend and inlcude?"
"What is a Ruby Module?"
"What is unit testing?"
"What is noSQL?"
"What is REDIS?"
"How would you diagnose, and resolve slow DB queries?"
"How does nginx differ from Apache?"
"What is a Rails environment?"
"What are the various Ruby iterators?"
"When might you use the inject method?"
"What's your favorite Ruby gem, and why?"

I can't speak for the rest of the country, but if you're looking for a job as a Rails Dev, in San Francisco, you should be able to answer to every questions listed above. If you're looking for any kind of programming job, regardless of whether or not it involves Ruby/Rails, it is essential that you can confidently answer the first set of bolded questions.

Personally, I've still got a lot to learn about Rails development, so I've signed up forDev Bootcamp in San Francisco, a 10 week course, designed to turn apsiring Rails engineers into Junior Web Developers.

I think that about sums it up. Good luck to all you aspiring Rails developers.

Tuesday, August 7, 2012

Javascript Framework Popularity

With the growing popularity of JS Frameworks, and the dizzying array of choices for developers, I thought others might like to know a little more information about some of their options. So, I've put together a little chart, showing the number of watchers, forks, and open issues for a handful of JS MVC's using the Github API.


If you're serious about researching the differences between the various frameworks, I'd recommend first reading  Gordon Hempton's article... 

where he dives a little bit into what the various frameworks have to offer, along with a few pros and cons for each. The second thing I'd do is check out Addy Osmani's site...

where he writes the same application using a variety of frameworks.

According to Github, Backbone is really kicking ass, but I'm hoping to see Angular gain more ground.

Wednesday, July 11, 2012

Installing Apache2.2 on Windows7 & Stolen Ports

I installed Apache2.2 on my Windows7 machine, only to find that once installed, the Apache wouldn't start. It turns out that Skype, by default, uses ports 80 & 443, which Apache prefers to use. However, there's an easy fix. Simply open Skype, and select Tools => Options => Advanced => Connection, and uncheck 'Use port 80 and 443 as alternatives for incoming connections', and restart Skype. Now Apache should have the ports that it likes, and you can tell all your "friends" about it.