Friday, April 19, 2013

A classmate has also blogged about his experience at Code Fellows. Check out his blog post: Alec Matias - 6 Reasons Why YOU should be a Code Fellow!

Monday, April 15, 2013

You Can’t Bill-Cap Your Amazon Web Services Account

Over the last few days I’ve been playing around with uploading files, and I’ve begun looking into using Amazon’s Simple Storage Service as a file host solution. However, I’m a pretty conservative cost-conscious guy, and Amazon requires your account to be tied to a credit card. So the second thing that I looked into after creating an account (and multi-factor authentication), was Bill Capping. I’d like to set it up so that Amazon wouldn’t let my account accrue costs over $10.

To my surprise, Amazon doesn’t seem to have this feature, even though developers have been requesting for it. Instead, since last year, Amazon has added a Billing Alert feature to Amazon CloudWatch. Over at Quora, an engineer argues that this is actually a better, more flexible solution, since different AWS customers may want to react to overages in different ways.

For more information about the billing alert, see this blog post: Monitor Estimated Charges Using Billing Alerts

Friday, April 12, 2013

Capybara locator and capitalization

If you’re using Capybara to fill in text fields in your tests, be aware that the locator parameter needs to be exactly the same as a label, id, or name. This behaviour means that you may need to be careful about capitalization in your tests.

For example, if you have a form that looks like this:

<%= form_for @document do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :title %> <br/>
    <%= f.text_field :title %>
  </p>
  <%= f.submit %>
<% end %>

And then your test contains this line:

fill_in 'title', with: "Lorem Ipsum"

It will fail with an error message, indicating that fill_in 'title' has failed.

Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with 
id, name, or label 'title' found

The reason for this is because the generated HTML does not have a text field id or name that is equal to ‘title’. They’re actually prefixed with the object that you’re passing into the form_for:

<input id="document_title" name="document[title]" 
size="30" type="text"></p>

But what about label? Didn’t we have f.label :title? Shouldn’t that get matched? Unfortunately, the word ‘title’ was actually capitalized in the generated HTML’s label field:

<label for="document_title">Title</label> 


So in order to compensate for this, you should change the capitalization in your test to:

fill_in 'Title', with: "Lorem Ipsum"

Or even…

fill_in :title, with: "Lorem Ipsum"

… Or use the exact id or name (i.e. document_title), then the fill_in method call in your test will be able to proceed successfully.

Thursday, April 4, 2013

On Code Fellows, Part 1

This is Part 1 of a series of blog posts about my experience at Code Fellows. If you have any questions, please leave a comment below.

I’ve recently completed a 4-week technical bootcamp in Seattle called Code Fellows.

Code Fellows is a education start-up from some of the folks behind Tech Stars Seattle. Like other education startups (1, 2, 3, 4, 5, 6, 7, 8), the idea is to give curious students an environment to learn modern web app development skills and prepare them for careers in tech. Unlike other programs, however, Code Fellows is shorter (4 weeks), cheaper ($4,000), and has a selection process that’s slightly slanted towards people who already have programming skills or have careers related to building websites.

For its inaugural class, twenty students were chosen (out of a pool of a few hundred applicants) to participate in the Ruby on Rails bootcamp. The students came from a variety of backgrounds, with careers in electrical engineering, user experience, IT management, research sciences, 3D modelling, front-end development, as well as creating startups. Most of the students were from the Seattle area, but a few traveled here from the east. I’m from Vancouver, Canada, which is only about three hours and a border away.

The actual bootcamp consisted of mostly hands-on learning, with classes that are set up in the “flipped classroom” format. Students would essentially spend afternoons/evenings reading and coding a chapter of the Rails 3 in Action book, while the instructors hovered around (uh, art director-style?) to answer questions. (I’ll have more to say about the book in the next blog post…) The morning sessions are then dedicated to answering questions, exploring the material in depth in an IRB, or lecturing on abstract topics such as the HTTP request lifecycle. I found this class format to be pretty conductive to learning. I’ve attended a few corporate training and college courses in the past where programming concepts are delivered via lectures, and I find that the concepts in this class to ‘stick’ more. Perhaps it’s the fact that we had more hands-on time, and we pushed code to GitHub every day.

Code Fellows had great instructors: Brook Riggio, who has taught at Ready Set Rails, and Ivan Storck who also teaches Rails at the University of Washington. I found them to be generous, attentive, and knowledgable. I especially appreciate that they were experienced as instructors, rather than only as developers, so their instruction felt tuned to students’ needs.

Damon Cortesi from Simply Measured

Fridays at Code Fellows were dedicated to career talks. Since the course took place in the TechStars office, Code Fellows was able to invite speakers from local tech companies to share their thoughts about building businesses, being developers, and interviewing. I found most of the talks to be quite memorable and illuminating. It was especially fun to ask Matt Shobe (FeedBurner co-founder) for his thoughts on RSS the day after Google announced Reader’s pending shutdown.

(This was Part 1 of a series of blog posts about my experience at Code Fellows. In the next post, I’ll talk more about my feelings about the program, some feedback that I’ve heard from non-programmer classmates, and my thoughts for the next class.)

Friday, March 29, 2013

Here are the slides from a Lightning Talk that I gave to the March 2013 Code Fellows bootcamp. It’s about the Kaminari and Faker gems.

Tuesday, March 26, 2013

I was looking around for best practices on writing Rails controllers that handle both single and multiple item CRUD, and I found this blog post by Stephen Chu. He has these few lines of clever recursion code.

(via STEPHEN CHU . com: params[:fu] #5 ) Update multiple models in update action atomically.)

Saturday, November 24, 2012
Paper for iPad is pretty fun.

Paper for iPad is pretty fun.

Thursday, October 4, 2012

Mark Zuckerberg’s continued crusade to make one’s Facebook profile a more accurate portrait of a person’s soul is not only highly presumptive about the capacity for computers to analyze people; it also discounts the very essence of humanity and the value of the non-digital world. If someone can be completely encapsulated by a bunch of photos, links, and pokes, do you really want to be friends with them anyway?

[…] in an attempt to grow more serious by constraining its users’ self-presentation, Facebook is actively distancing itself from its most innovative and influential users. They are the ones who bring advertisers their biggest potential ROI; they’re also the ones who will drop any social media network at the slightest hint there’s something better lurking a few clusters away at a different URL. You might want to check in with Tom and Rupert Murdoch about this.

[…] Any internet entity that defines itself as an essential element of human life is one that has overstretched its boundaries; it’s also one that has, historically, indicated its own inevitable collapse.

In Mark Zuckerberg’s world, lying is the only way to be yourself | The Verge

Great piece. I share some of the same criticisms toward Facebook. In an interview today, Mark Zuckerberg claims that Steve Jobs inspired him to be maniacally focused on the user. I feel like this isn’t exactly true. The way Facebook is engineered is often anti-user intent, with practices that ensure people are addicted, locked-in, and over-sharing on the network. That’s not having the user in mind, that’s manipulative towards Facebook’s own intention — and ambitions.

Friday, September 21, 2012 Thursday, September 20, 2012