December 2011
10 posts
6 tags
Evaluating alternative Decorator implementations...
Recently, decorators have become a big part of my Ruby on Rails life.
We used them heavily in a recent client project, Harold Giménez wrote a great post about them, Avdi Grimm is writing about them in Objects on Rails, and Jeff Casimir has a great presentation about them.
Until recently, I still had some questions, however, such as:
Should I roll my own decorators?
If I roll my own, what...
4 tags
A quick screencast that shows how I use CSS snippets to speed up my workflow.
Links Mentioned in video:
Textmate Zen CSS
Textmate SCSS
Vim CSS Snippets
My Vim CSS Snippets
7 tags
This week in open source
paperclip
Much of the work over the past week was done in paperclip, so now you can upload files to your Rails apps with more flare and style!
It now supports an option for keeping old files, so you can pass :keep_old_files to has_attached_file and, when you destroy an attachment (@user.avatar.destroy) it won’t actually delete the underlying files (345ec74). Many people find this useful...
5 tags
Internship or Apprenticeship?
What’s the difference between an internship and an apprenticeship?
Internship
An intern is someone who:
usually wants to explore many options for their next job, or career in general
may be unpaid
is probably in school
A company who hires interns:
often has special project work that is a good fit for part-time employees
knows it’s very likely the intern will work or study...
2 tags
This week in open source
Few commits over the past week. We’ve been hard at work on refactorings and larger features (plus client work), so keep your eyes peeled for the amazing commits we pull from you (yes, you!) in coming weeks.
suspenders
Commits on suspenders this week bring us instructions on how to use the app with Heroku (257ea39 and 5a4c257), revised documentation “that is awesome, not...
1 tag
Here's an Idea
Today we’ve launched several major changes to the Discussions feature of Trajectory. These changes lay the groundwork for many more improvements we’d like to make to Trajectory in the future to make your projects more successful.
Discussions are one of the things that make Trajectory different than other story planning tools out there. Create a discussion instead of a vague story...
3 tags
The Durable Document Store You Didn't Know You...
As it turns out, PostgreSQL has a number of ways of storing loosely structured data — documents — in a column on a table.
hstore is a data type available as a contrib package that allows you to store key/value structures just like a dictionary or hash.
You can store data in JSON format on a text field, and then use PLV8 to JSON.parse() it right in the database.
There is a native xml data type,...
7 tags
I learned to alias shell commands with Hooked on...
Do your co-workers snicker at your sentence-length shell aliases? I’m here to tell you it’s okay because my aliases border on the Dostoyevskian, too.
Some commands you do a thousand times a day. They deserve super-short aliases:
alias be="bundle exec"
alias s="bundle exec rspec"
alias cuc="bundle exec cucumber"
Like h() or t() in Rails, the more often you invoke a command, the...
3 tags
This week in open source
Since last week was Thanksgiving here in the States, here’s a double-whammy: everything that happened last week and everything that’s happened this week, in one blog post!
suspenders
The big deal with suspenders, our app app, is that version 0.3.2 is officially out! Since 0.3.1 on October 28th we’ve added an email validator, raised email delivery errors in the development...
6 tags
Tidy views and beyond with Decorators
The problem
Here’s a view serving monkeys#show. What’s wrong with it?
<h1><%= @monkey.name -%>'s Monkey page</h1>
<% if @monkey.eating? %>
<div class="eating">
<h2><%= @monkey.name -%> is eating. Nom nom.</h2>
</div>
<% elsif @monkey.sleeping? %>
<div class="sleeping">
<h2><%= @monkey.name %>...