Posted over 2 years back at Railscasts
Use checkboxes to select multiple records and edit them all in one form as shown in this episode. With virtual attributes you can even edit values relatively!
Posted over 2 years back at Jake Scruggs
I spent the week doing an iteration zero for new project. The idea behind iteration zero is to get the development environment as automated as possible so developers can spend their time coding when the real development begins.
So here's what we did:
1. Set up new git repository
We use
GitHub so that only took a few minutes.
2. Make new Rails app
Again, just a few minutes
3. Set up geminstaller and basic gems (HAML etc.)
Geminstaller installs gems needed by the project and makes sure they are there before starting the app. This functionality has been pulled into modern versions of Rails now, but I've found it a little wonky and I'm working with a former
Pivotal Labs guy who just loves the Pivotal stuff (don't even get him started on
Tracker vs
Mingle).
4. Set up developer tests.
We looked into
Shoulda, but ultimately went with
RSpec (although we may use the Shoulda macros to test ActiveRecord) because most of the criticisms of RSpec are that it's too heavy. To that I say: "Give Shoulda some time and success and then see if it's still light." Feel free to flame my comments section.
We used
Polonium. We could have gone with
WebRat, but no one on the project had ever used WebRat and one guy had extensive experience with Polonium. Our build now fires up a browser and clicks through the app (we will be taking pains to keep this suite short -- just a smoke test really).
6. Set up Continuous Integration
We went with
CruiseControl.rb. Note: Use the ThoughtWorks version on GitHub. If you go to the main CruiseControl.rb page it will direct you to an old version that doesn't support Git.
7. Set up scripted deploy
Looked into
Vlad the Deployer, but it's lack of documentation did it in. I know it's supposed to be much simpler than
Capistrano, but we couldn't get it to work. Capistrano is fine, but it's basic documentation starts talking about spinners and spawners at some point. Wasn't that like 4 years ago? Here's my advice: Follow the capify.org "
from the beginning tutorial" but skip the spinners and spawners stuff and just put this in your capfile:
namespace :deploy do
desc "Start the server"
task :start, :roles => :app do
run "mongrel_rails start -e production -c #{current_path} -d -p 3000"
end
desc "Stop the server"
task :stop, :roles => :app do
run "mongrel_rails stop -c #{current_path}"
end
desc "Restart the server"
task :restart, :roles => :app do
stop
start
end
end
That's good enough to get you going. Basically you overwrite the stop, start, and restart tasks that cap uses under the covers. I should point out that I'm using Capistrano version 2.5.5 because all the doc for cap I find on the web never mentions the version they are talking about and it drives me crazy. Cap has changed A LOT over the years and something that was perfectly good in 2006-7 may not be so relevant now. Also, we're using
capistrano-ext version 1.2.1 so we can deploy to multiple environments.
8. Set up Demo and QA environments
After the previous task, this was easy. All we have to do is 'cap demo deploy:setup' and 'cap demo deploy' to get the demo environment up and running. QA was the same except for, uh, using the letters 'qa' instead of 'demo.' Now we can deploy with one command -- w00t.
9. Set up NewRelic
NewRelic lets you profile your Rails app with ease. I've used it before on apps I've written and have found it immensely useful in tracking down slow parts of the project.
10. Make Cruise Control run a Metrics Build every 24 hours.
Yep, I really do use
metric_fu on my projects. I like installing it from the get-go so we can keep an eye on things and track changes to the app.
Well, that ended up being about a week for a pair of developers (with some interruptions for meetings and other stuff) and a pretty good iteration zero if I do say so myself.
Posted over 2 years back at Dr Nic
“this article shows how I used test-driven development tools and processes on a Greasemonkey script.” Though it also includes free ninjas.
When I do online banking I need to select from a large list of other people’s bank accounts to which I might like to transfer money too. It is the massive drop down list that I must scroll through that I wish to raise issue with today. The problem of having to give other people money is probably a different discussion.
And take those time-zone selector drop down lists, for example, the massively long list rendered by Rails’ time_zone_select helper. Granted, I am thankful for you letting me choose my timezone in your web app. Though for those of us not living in the USA we must hunt for our closest city in the list. Dozens of locations, ordered by time zone and not the name of the city (see adjacent image). Unfortunately you can’t easily type a few letters of your current city to find it. Rather, you have to scroll. And if you live in the GMT+1000 time zone group (Eastern Australia), you have to scroll all the way to the bottom.

So I got to thinking I’d like a Greasemonkey (for Firefox) or GreaseKit (for Safari) script that automatically converted all ridiculously long HTML drop down lists into a sexy, autocompletion text field. You could then type in “bris” and be presented with “(GMT+1000) Brisbane”, or given the less amusing banking scenario then I could type “ATO” and get the bank account details for the Australian Tax Office.
I mean, how hard could it be?
This article is two things: an introduction to Ninja Search JS which gives a friendly ninja for every drop down field to solve the above problem. Mostly, the rest of this article shows how I used test-driven development tools and processes on a Greasemonkey script.
Introducing Ninja Search JS
Click the banner to learn about and install the awesome Ninja Search JS. It includes free ninjas.
Currently it is a script for Greasemonkey (FireFox) or GreaseKit (Safari). It could be dynamically installed as necessary via a bookmarklet. I just haven’t done that yet. It could also be a FireFox extension so it didn’t have to fetch remote CSS and JS assets each time.
Ninja Search JS uses liquidmetal and jquery-flexselect projects created by Ryan McGeary.
Most importantly of all, I think, is that I wrote it all using TDD. That is, tests first. I don’t think this is an erroneous statement given the relatively ridiculous, and unimportant nature of Ninja Search JS itself.
TDD for Greasemonkey scripts
I love the simple idea of Greasemonkey scripts: run a script on a subset of all websites you visit. You can’t easily do this on desktop apps, which is why web apps are so awesome – its just HTML inside your browser, and with Greasemoney or browser extensions you can hook into that HTML, add your own DOM, remove DOM, add events etc.
But what stops me writing more of them is that once you cobble together a script, you push it out into the wild and then bug reports start coming back. Or feature requests, preferably. I’d now have a code base without any test coverage, so each new change is likely to break something else. Its also difficult to isolate bugs across different browsers, or in different environments (running Ninja Search JS in a page that used prototypejs originally failed), without a test suite.
And the best way to get yourself a test suite is to write it before you write the code itself. I believe this to be true because I know it sucks writing tests after I’ve writing the code.
I mostly focused on unit testing this script rather than integration testing. With integration testing I’d need to install the script into Greasemonkey, then display some HTML, then run the tests. I’ve no idea how’d I’d do that.
But I do know how to unit test JavaScript, and if I can get good coverage of the core libraries, then I should be able to slap the Greasemonkey specific code on top and do manual QA testing after that. The Greasemonkey specific code shouldn’t ever change much (it just loads up CSS and more JS code dynamically) so I feel ok about this approach.
For this project I used Screw.Unit for the first time (via a modified version of the blue-ridge rails plugin) and it was pretty sweet. Especially being able to run single tests or groups of tests in isolation.
Project structure
All the JavaScript source – including dependent libraries such as jquery and jquery-flexselect – was put into the public folder. This is because I needed to be able to load the files into the browser without using file:// protocol (which was failing for me). So, I moved the entire project into my Sites folder, and added the project as a Passenger web app. I’m ahead of myself, but there is a reason I went with public for the JavaScript + assets folder.
In vendor/plugins, The blue-ridge rails plugin is a composite of several JavaScript libraries, including the test framework Screw.Unit, and a headless rake task to run all the tests without browser windows popping up everywhere. In my code base blue-ridge is slightly modified since my project doesn’t look like a rails app.
Our tests go in spec. In a Rails app using blue-ridge, they’d go in spec/javascripts, but since JavaScript is all we have in this project I’ve flattened the spec folder structure.
The website folder houses the github pages website (a git submodule to the gh-pages branch) and also the greasemonkey script and its runtime JavaScript, CSS, and ninja image assets.
A simple first test
For the Ninja Search JS I wanted to add the little ninja icon next to every <select> element on every page I ever visited. When the icon is clicked, it would convert the corresponding <select> element into a text field with fantastical autocompletion support.
For Screw.Unit, the first thing we need is a spec/ninja_search_spec.js file for the tests, and an HTML fixture file that will be loaded into the browser. The HTML file’s name must match to the corresponding test name, so it must be spec/fixtures/ninja_search.html.
For our first test we want the cute ninja icon to appear next to <select> drop downs.
require("spec_helper.js");
require("../public/ninja_search.js"); // relative to spec folder
Screw.Unit(function(){
describe("inline activation button", function(){
it("should display NinjaSearch image button", function(){
var button = $('a.ninja_search_activation');
expect(button.size()).to(be_gte, 1);
});
});
});
The Blue Ridge textmate bundle makes it really easy to create the describe (des) and it (it) blocks, and ex expands into a useful expects(...).to(matcher, ...) snippet.
The two ellipses are values that are compared by a matcher. Matchers are available via global names such as equals, be_gte (greater than or equal) etc. See the matchers.js file for the default available matchers.
The HTML fixture file is important in that it includes the sample HTML upon which the tests are executed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ninja Search | JavaScript Testing Results</title>
<link rel="stylesheet" href="screw.css" type="text/css" charset="utf-8" />
<script src="../../vendor/plugins/blue-ridge/lib/blue-ridge.js"></script>
</head>
<body>
<div>
<label for="person_user_time_zone_id">Main drop down for tests</label>
<select name="person[user][time_zone_id]" id="person_user_time_zone_id" style="display: inline;">
<option value="Hawaii">(GMT-10:00) Hawaii</option>
<option value="Alaska">(GMT-09:00) Alaska</option>
<option value="Pacific Time (US & Canada)">(GMT-08:00) Pacific Time (US & Canada)</option>
<option value="Arizona">(GMT-07:00) Arizona</option>
<option value="Mountain Time (US & Canada)">(GMT-07:00) Mountain Time (US & Canada)</option>
<option value="Central Time (US & Canada)">(GMT-06:00) Central Time (US & Canada)</option>
<option value="Eastern Time (US & Canada)">(GMT-05:00) Eastern Time (US & Canada)</option>
</select>
</div>
</body>
</html>
In its header it loads the blue-ridge JavaScript library, which in turn loads Screw.Unit and ultimately our spec.js test file (based on corresponding file name), so ninja_search.html will cause a file spec/ninja_search_spec.js to be loaded.
To run our first test just load up the spec/fixtures/ninja_search.html file into your browser.
Your first test will fail. But that’s ok, that’s the point of TDD. Red, green, refactor.
Simple passing code
So now we need some code to make the test pass.
Create a file public/ninja_search.js and something like the following should work:
(function($){
$(function() {
$('select').each(function(index) {
var id = $(this).attr('id');
// create the Ninja Search button, with rel attribute referencing corresponding >select id="...">
$('> class="ninja_search_activation" rel="' + id + '">ninja search>/a>')
.insertAfter($(this));
});
});
})(jQuery);
Reload your test fixtures HTML file and the test should pass.
Now rinse and repeat. The final suite of tests and fixture files for Ninja Search JS are on github.
Building a Greasemonkey script
Typically Greasemonkey scripts are all-inclusive affairs. One JavaScript file, named my_script.user.js, typically does the trick.
I decided I wanted a thin Greasemonkey script that would dynamically load my ninja-search.js, and any stylesheets and dependent libraries. This would allow people to install the thin Greasemonkey script once, and I can deploy new versions of the actual code base over time without them having to re-install anything.
Ultimately in production, the stylesheets, images, and JavaScript code would be hosted on the intertubes somewhere. Though during development that would be long-winded and painful to push the code to a remote host just to run tests.
So I have three Greasemonkey scripts:
public/ninja_search.dev.user.js – loads each dependent library and asset from the local file system
public/ninja_search.local.user.js – loads compressed library and asset from the local file system
public/ninja_search.user.js – loads compressed library and assets from remote server
Let’s ignore the optimisation of compressing dependent JavaScript libraries for the moment and just look at the dev.user.js and user.js files.
The two scripts differ in the target host from which they load assets and libraries. ninja_search.dev.user.js loads them from the local machine and ninja_search.user.js loads them from a remote server.
For example ninja_search.dev.user.js loads local dependencies like this:
require("http://ninja-search-js.local/jquery.js");
require("http://ninja-search-js.local/ninja_search.js");
And ninja_search.user.js loads remote dependencies like this:
require("http://drnic.github.com/ninja-search-js/dist/jquery.js");
require("http://drnic.github.com/ninja-search-js/dist/ninja_search.js");
In the final version of ninja_search.user.js we load a simple, conpressed library containing jquery, our code, and other dependencies, called ninja_search_complete.js.
Using Passenger to server local libraries
The problem with loading local JavaScript libraries using the file:// protocol, inferred earlier, is that it doesn’t work. So if I can’t load libraries using file:// then I must use the http:// protocol. That means I must route the requests through Apache/Ningx.
Fortunately there is a very simple solution: use Phusion Passenger which serves a “web app’s” public folder automatically. That’s why all the javascript, CSS and image assets have been placed in a folder public instead of src or lib or javascript.
On my OS X machine, I moved the repository folder into my Sites folder and wired up the folder as a Passenger web app using PassengerPane. It took 2 minutes and now I had http://ninja-search.local as a valid base URL to serve my JavaScript libraries to my Greasemonkey script.
Testing the Greasemonkey scripts
I can only have one of the three Greasemonkey scripts installed at a time, so I install the ninja-search.dev.user.js file to check that everything is basically working inside a browser on interesting, foreign sites (outside of the unit test HTML pages).
Once I’ve deployed the JavaScript files and assets to the remote server I can then install the ninja-search.user.js file (so can you) and double check that I haven’t screwed anything up.
Deploying via GitHub Pages
The normal, community place to upload and share Greasemonkey scripts is userscripts.org. This is great for one file scripts, though if your script includes CSS and image assets, let alone additional JavaScript libraries, then I don’t think its as helpful, which is a pity.
So I decided to deploy the ninja-search-js files into the project’s own GitHub Pages site.
After creating the GitHub Pages site using Pages Generator, I then pulled down the gh-pages branch, and then linked (via submodules) that branch into my master branch as website folder.
Something like:
git checkout origin/gh-pages -b gh-pages
git checkout master
git submodule add -b gh-pages git@github.com:drnic/ninja-search-js.git website
Now I can access the gh-pages branch from my master branch (where the code is).
Then to deploy our Greasemonkey script we just copy over all the public files into website/dist, and then commit and push the changes to the gh-pages branch.
mkdir -p website/dist
cp -R public/* website/dist/
cd website
git commit -a "latest script release"
git push origin gh-pages
cd ..
Then you wait very patiently for GitHub to deploy your latest website, which now contains your Greasemonkey script (dist/ninja-search.user.js) and all the libraries (our actual code), stylesheets and images.
Summary
Greasemonkey scripts might seem like small little chunks of code. But all code starts small and grows. At some stage you’ll wish you had some test coverage. And later you’ll hate yourself for ever having release the bloody thing in the first place.
I wrote all this up to summarise how I’d done TDD for the Ninja Search JS project, which is slightly different from how I added test cases to _why’s the octocat’s pajamas greasemonkey script when I first started hacking with unit testing Greasemonkey scripts. The next one will probably be slightly different again.
I feel good about the current project structure, I liked Screw.Unit and blue-ridge, and I’m amused by my use of GitHub Pages to deploy the application itself.
If anyone has any ideas on how this could be improved, or done radically differently, I’d love to hear them!
Polish your Rails project with Mocra
I want to help you, your business, your boss and your project reach delightful levels of wickedly awesomeness. I’m so proud of the small team of ace Rails developers here at Mocra and what I know we can do for you.
Send an email to rails@mocra.com about your current/future projects. Dare us to be more awesome!
While you wait for a reply perhaps you’d like to learn more about How we do it at Mocra?
Related posts:
- Nifty Threaded IM Chat within Gtalk/Gmail Chat Ever had IM chats where a conversation splits into multiple...
- To WebKit or not to WebKit within your iPhone app? I know HTML. Its on my CV. Expert level....
- newgem 1.0.0 all thanks to Cucumber The New Gem Generator (newgem) was exciting, moderately revolutionary, and...
Posted over 2 years back at technomancy.us
This week I had the good fortune to be in San Francisco
for a
meeting of the Bay Area Clojure Meetup. This meeting was a
special event since Clojure's creator, Rich Hickey, was in town
for the big JavaOne conference. We ended up packing out the room
with sixty people, which made it probably the largest gathering of
Clojure programmers ever.
The meeting began with a handful of so-called "lightning talks"
(of various lengths) on all sorts of topics. A few highlights were
Amit
Rathore's Swarmiji
clustering library and George Jahad's talk
on decompiling
Clojure with jdb, which showed tools to get a new perspective
on how your code gets compiled.
After these Rich gave a talk on the recent work he's been doing
on chunked sequences. Basically when a seq wraps a vector or
vector-like collection, rather than every first/rest invocation
breaking the vector down piece by piece, the seq can break a chunk
of the vector off to work on all at once and keep its own internal
counter that points to the current position in the chunk. The
motivation here was that while you generally can rely on the seq
abstraction to map over each element in a vector in a functional
manner, sometimes performance concerns force you to use a more
imperative-style loop instead. With the chunking in place, the map
approach is even more performant than the less-idiomatic loop, so
there's one fewer reason to stray from the functional
approach. It's really encouraging to see that Rich is making this
a priority—he wants to make sure that you never get
penalized for doing things the elegant way.
After this Rich hosted a Q&A session, from which two main
points stuck in my mind. He mentioned that before the 1.0 release,
he asked
what people thought would be a good set of short-term goals for
the project, to which the response was overwhelmingly "move
off SVN to git". Since the project was still fresh of a jump from
SourceForge to Google Code, he was reluctant at first, but he
seems to have been convinced that the distributed approach is
what's best for the community. He promised us that the move will
happen. He's
currently experimenting
with GitHub and making sure for himself that tool support is
good enough.
The other question of particular interest
was that
of tests. Rich doesn't write tests for Clojure. The community
has contributed a test suite, but it's kept in a separate
repository and doesn't offer full coverage. Rich's opinion is that
tests are for finding bugs, and that he is able to avoid bugs by
reasoning out the problem up front, so it's not a wise use of his
time for him to write his own tests, though he does appreciate and
run the community-provided suite. This made me very nervous at
first, but the next day I read
Out
of the Tarpit [PDF], a paper he recommended at the meeting.
The paper makes a strong case for informal reasoning being a
suitable substitute for test cases in codebases that exhibit
referential transparency. While I still prefer TDD for its help
in the design phase of coding, I'm much more ready to accept the
notion that thinking through the problem up front and verifying
it with manual tests is actually a feasible approach to getting
working code in functional languages, though of course in
situations where mutability is the norm it leads to disastrous
results.
Update: Videos
are up! (Unfortunately flash-only; sorry!)
Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home
I have a friend from another city who is considering a Ruby job in Boston. He asked me for advice on places to live.
Since we’re currently in the midst of hiring designers & developers & many candidates have been from other areas (we require that they move to Boston or New York), I thought I’d share publicly.
Opinions
If you’re a Rubyist or a designer, you’ve already got taste. The following neighborhoods are what I personally consider the nicest, most intellectually stimulating, aesthetically pleasing, or funkiest neighborhoods.
This is by no means comprehensive but that’s partly the point. Moving is stressful & keeping options limited lightens the mental burden.
Cost of living
Boston rent is not for the faint of heart. Expect to pay between $750-$1,250/month for a clean apartment close to Boston. You should be able to knock it down to $500/month if you share a bedroom with someone or live in Jamaica Plain.
However, average salary, and more importantly, the quality of life are also high.
Cambridge
I’ve mostly lived in Cambridge over the last 5 years so let’s start here. The Wikipedia entry hits the high points of Cambridge culture: Harvard University, MIT, the Charles River, & The Red Line.
The blue line encompasses the sections of Cambridge I’d recommend: most of Cambridge except areas that are more industrial or North Cambridge, which is just a little too far from downtown Boston for my tastes.
<iframe src="http://quikmaps.com/ext2/105975?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3701476&lng=-71.1045456&zl=13&mt=2" height="400" width="550"></iframe>
I put three pushpins in Boston for reference: Fenway Park, the Prudential Center, & Park Street at Boston Common (where the thoughtbot office is located).
If, like my friend, you’re not working downtown, but instead in Watertown, Waltham, Somerville, Medford, or Charlestown, I’d strongly recommend Cambridge.
Brookline
Again, the Wikipedia entry will give you the best overview of the town & it’s culture: John F. Kennedy, The Country Club, & The Green Line.
This is an area I’d recommend for people with kids. Quiet, safe, & great schools. It’s close to Waltham, Watertown, & the Mass Pike if you’re working out along Route 128. It’s also extremely convenient if you’re working in the Longwood area (I believe there are a number of hospitals & universities over there hiring Rubyists).
Within Brookline, Coolidge Corner & Washington Square are the two areas I would focus on. They’re both right on the Green Line along Beacon Street & have plenty of things worth walking to.
<iframe src="http://quikmaps.com/ext2/105977?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.34075055&lng=-71.12754819999999&zl=14&mt=2" height="400" width="550"></iframe>
Jamaica Plain
Wikipedia calls Jamaica Plain The Eden of America. I can see that.
This is where you want to be if you’re a park lover or a real artist. The population is extremely diverse demographically. The Milky Way Lounge (Latin dance nights), JP Licks (ice cream), & Doyle’s Cafe (oldest Irish pub in Boston, longtime evening hangout for the city’s Irish politicians) are iconic institutions.
The area I’d recommend is bounded by the Orange Line on the right, the ponds on the left, and is split by Centre Street, which is filled with attractive cafes, galleries, restaurants & shops.
<iframe src="http://quikmaps.com/ext2/105995?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.31478155&lng=-71.1131501&zl=14&mt=2" height="400" width="550"></iframe>
South End
Scan through the Wikipedia entry then take a walk through the area. If you’re not touched by the signature brick architecture of Boston that is prevalent in the South End, you have no heart. You’re probably a vampire. Might want to get that checked out.
The South End is known as a gay & artistic neighborhood. Tremont Street may have the greatest concentration of “Saturday night date restaurants” in the city. Unbelievable food over there. Lots of theaters, lots of music, lots of visual arts.
I’ve bounded the South End by some major streets.
<iframe src="http://quikmaps.com/ext2/105996?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3423526&lng=-71.07392549999999&zl=15&mt=2" height="400" width="550"></iframe>
It’s a tricking balancing act of trying to live in the South End, however. The closer you are to Copley, the closer you are to some of the highest rent areas of Boston. The closer to Washington Street, the further you are from all subway lines & the closer you are to some higher crime areas. Like any city, however, often the best places to live are on the edge of gentrification of former combat zones.
For the venture capitalists…
It wouldn’t be tour through Boston’s neighborhoods if I didn’t point out the Back Bay, Beacon Hill, & the North End.
These are all awesome neighborhoods that are out of the price range of most individuals unless you’re the kind of person who likes to fund Twitter or knock home runs out of Fenway Park.
<iframe src="http://quikmaps.com/ext2/105998?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3581626&lng=-71.07210160000001&zl=14&mt=2" height="400" width="500"></iframe>
Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home
I have a friend from another city who is considering a Ruby job in Boston. He asked me for advice on places to live.
Since we’re currently in the midst of hiring designers & developers & many candidates have been from other areas (we require that they move to Boston or New York), I thought I’d share publicly.
Opinions
If you’re a Rubyist or a designer, you’ve already got taste. The following neighborhoods are what I personally consider the nicest, most intellectually stimulating, aesthetically pleasing, or funkiest neighborhoods.
This is by no means comprehensive but that’s partly the point. Moving is stressful & keeping options limited lightens the mental burden.
Cost of living
Boston rent is not for the faint of heart. Expect to pay between $750-$1,250/month for a clean apartment close to Boston. You should be able to knock it down to $500/month if you share a bedroom with someone or live in Jamaica Plain.
However, average salary, and more importantly, the quality of life are also high.
Cambridge
I’ve mostly lived in Cambridge over the last 5 years so let’s start here. The Wikipedia entry hits the high points of Cambridge culture: Harvard University, MIT, the Charles River, & The Red Line.
The blue line encompasses the sections of Cambridge I’d recommend: most of Cambridge except areas that are more industrial or North Cambridge, which is just a little too far from downtown Boston for my tastes.
<iframe src="http://quikmaps.com/ext2/105975?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3701476&lng=-71.1045456&zl=13&mt=2" height="400" width="550"></iframe>
I put three pushpins in Boston for reference: Fenway Park, the Prudential Center, & Park Street at Boston Common (where the thoughtbot office is located).
If, like my friend, you’re not working downtown, but instead in Watertown, Waltham, Somerville, Medford, or Charlestown, I’d strongly recommend Cambridge.
Brookline
Again, the Wikipedia entry will give you the best overview of the town & it’s culture: John F. Kennedy, The Country Club, & The Green Line.
This is an area I’d recommend for people with kids. Quiet, safe, & great schools. It’s close to Waltham, Watertown, & the Mass Pike if you’re working out along Route 128. It’s also extremely convenient if you’re working in the Longwood area (I believe there are a number of hospitals & universities over there hiring Rubyists).
Within Brookline, Coolidge Corner & Washington Square are the two areas I would focus on. They’re both right on the Green Line along Beacon Street & have plenty of things worth walking to.
<iframe src="http://quikmaps.com/ext2/105977?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.34075055&lng=-71.12754819999999&zl=14&mt=2" height="400" width="550"></iframe>
Jamaica Plain
Wikipedia calls Jamaica Plain The Eden of America. I can see that.
This is where you want to be if you’re a park lover or a real artist. The population is extremely diverse demographically. The Milky Way Lounge (Latin dance nights), JP Licks (ice cream), & Doyle’s Cafe (oldest Irish pub in Boston, longtime evening hangout for the city’s Irish politicians) are iconic institutions.
The area I’d recommend is bounded by the Orange Line on the right, the ponds on the left, and is split by Centre Street, which is filled with attractive cafes, galleries, restaurants & shops.
<iframe src="http://quikmaps.com/ext2/105995?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.31478155&lng=-71.1131501&zl=14&mt=2" height="400" width="550"></iframe>
South End
Scan through the Wikipedia entry then take a walk through the area. If you’re not touched by the signature brick architecture of Boston that is prevalent in the South End, you have no heart. You’re probably a vampire. Might want to get that checked out.
The South End is known as a gay & artistic neighborhood. Tremont Street may have the greatest concentration of “Saturday night date restaurants” in the city. Unbelievable food over there. Lots of theaters, lots of music, lots of visual arts.
I’ve bounded the South End by some major streets.
<iframe src="http://quikmaps.com/ext2/105996?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3423526&lng=-71.07392549999999&zl=15&mt=2" height="400" width="550"></iframe>
It’s a tricking balancing act of trying to live in the South End, however. The closer you are to Copley, the closer you are to some of the highest rent areas of Boston. The closer to Washington Street, the further you are from all subway lines & the closer you are to some higher crime areas. Like any city, however, often the best places to live are on the edge of gentrification of former combat zones.
For the venture capitalists…
It wouldn’t be tour through Boston’s neighborhoods if I didn’t point out the Back Bay, Beacon Hill, & the North End.
These are all awesome neighborhoods that are out of the price range of most individuals unless you’re the kind of person who likes to fund Twitter or knock home runs out of Fenway Park.
<iframe src="http://quikmaps.com/ext2/105998?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3581626&lng=-71.07210160000001&zl=14&mt=2" height="400" width="500"></iframe>
Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home
I have a friend from another city who is considering a Ruby job in Boston. He asked me for advice on places to live.
Since we’re currently in the midst of hiring designers & developers & many candidates have been from other areas (we require that they move to Boston or New York), I thought I’d share publicly.
Opinions
If you’re a Rubyist or a designer, you’ve already got taste. The following neighborhoods are what I personally consider the nicest, most intellectually stimulating, aesthetically pleasing, or funkiest neighborhoods.
This is by no means comprehensive but that’s partly the point. Moving is stressful & keeping options limited lightens the mental burden.
Cost of living
Boston rent is not for the faint of heart. Expect to pay between $750-$1,250/month for a clean apartment close to Boston. You should be able to knock it down to $500/month if you share a bedroom with someone or live in Jamaica Plain.
However, average salary, and more importantly, the quality of life are also high.
Cambridge
I’ve mostly lived in Cambridge over the last 5 years so let’s start here. The Wikipedia entry hits the high points of Cambridge culture: Harvard University, MIT, the Charles River, & The Red Line.
The blue line encompasses the sections of Cambridge I’d recommend: most of Cambridge except areas that are more industrial or North Cambridge, which is just a little too far from downtown Boston for my tastes.
<iframe src="http://quikmaps.com/ext2/105975?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3701476&lng=-71.1045456&zl=13&mt=2" frameborder="0" scrolling="no" width="550" height="400" marginwidth="0" marginheight="0"></iframe>
I put three pushpins in Boston for reference: Fenway Park, the Prudential Center, & Park Street at Boston Common (where the thoughtbot office is located).
If, like my friend, you’re not working downtown, but instead in Watertown, Waltham, Somerville, Medford, or Charlestown, I’d strongly recommend Cambridge.
Brookline
Again, the Wikipedia entry will give you the best overview of the town & it’s culture: John F. Kennedy, The Country Club, & The Green Line.
This is an area I’d recommend for people with kids. Quiet, safe, & great schools. It’s close to Waltham, Watertown, & the Mass Pike if you’re working out along Route 128. It’s also extremely convenient if you’re working in the Longwood area (I believe there are a number of hospitals & universities over there hiring Rubyists).
Within Brookline, Coolidge Corner & Washington Square are the two areas I would focus on. They’re both right on the Green Line along Beacon Street & have plenty of things worth walking to.
<iframe src="http://quikmaps.com/ext2/105977?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.34075055&lng=-71.12754819999999&zl=14&mt=2" frameborder="0" scrolling="no" width="550" height="400" marginwidth="0" marginheight="0"></iframe>
Jamaica Plain
Wikipedia calls Jamaica Plain The Eden of America. I can see that.
This is where you want to be if you’re a park lover or a real artist. The population is extremely diverse demographically. The Milky Way Lounge (Latin dance nights), JP Licks (ice cream), & Doyle’s Cafe (oldest Irish pub in Boston, longtime evening hangout for the city’s Irish politicians) are iconic institutions.
The area I’d recommend is bounded by the Orange Line on the right, the ponds on the left, and is split by Centre Street, which is filled with attractive cafes, galleries, restaurants & shops.
<iframe src="http://quikmaps.com/ext2/105995?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.31478155&lng=-71.1131501&zl=14&mt=2" frameborder="0" scrolling="no" width="550" height="400" marginwidth="0" marginheight="0"></iframe>
South End
Scan through the Wikipedia entry then take a walk through the area. If you’re not touched by the signature brick architecture of Boston that is prevalent in the South End, you have no heart. You’re probably a vampire. Might want to get that checked out.
The South End is known as a gay & artistic neighborhood. Tremont Street may have the greatest concentration of “Saturday night date restaurants” in the city. Unbelievable food over there. Lots of theaters, lots of music, lots of visual arts.
I’ve bounded the South End by some major streets.
<iframe src="http://quikmaps.com/ext2/105996?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3423526&lng=-71.07392549999999&zl=15&mt=2" frameborder="0" scrolling="no" width="550" height="400" marginwidth="0" marginheight="0"></iframe>
It’s a tricking balancing act of trying to live in the South End, however. The closer you are to Copley, the closer you are to some of the highest rent areas of Boston. The closer to Washington Street, the further you are from all subway lines & the closer you are to some higher crime areas. Like any city, however, often the best places to live are on the edge of gentrification of former combat zones.
For the venture capitalists…
It wouldn’t be tour through Boston’s neighborhoods if I didn’t point out the Back Bay, Beacon Hill, & the North End.
These are all awesome neighborhoods that are out of the price range of most individuals unless you’re the kind of person who likes to fund Twitter or knock home runs out of Fenway Park.
<iframe src="http://quikmaps.com/ext2/105998?t=1&ln=0&sn=1&zb=0&d=1&o=0&lat=42.3581626&lng=-71.07210160000001&zl=14&mt=2" frameborder="0" scrolling="no" width="500" height="400" marginwidth="0" marginheight="0"></iframe>
Posted over 2 years back at RicRoberts :
Over the years, I’ve collected a fair number of Ruby blogs in my feed reader. I thought I’d start sharing them for the benefit of others (in no particular order). Here’s the first installment – I’ll list some more at a later date.
- Ruby Best Practices – New(ish) blog about writing better Ruby code, to accompany the new O’Reilly book of the same name.
- Ruby Flow – Community generated Ruby links site.
- Rails Envy – Amusing but informative Rails-news podcasts by Jason Seifer and Gregg Pollack.
- Ryans Scraps – Great resource for keeping up with developments in Edge-Rails.
- The Rails Way – Blog about Rails best practices, run by Michael Koziarski, Rails-core member.
Posted over 2 years back at Ruby on Rails Podcast
An entrepreneur talks about the scrum management process and a new site his company built in Rails to help companies and individuals manage projects.
Posted over 2 years back at Robert Evans - Home
Moving
I’ll not be posting much on this blog anymore. Instead, I’ll be posting on my new business venture’s site, FACollective (http://www.facollective.com). FACollective is owned by John Moorhead, Jake Stutzman and myself.
We will actively be posting articles talking about design, development and entrepreneurship. Some of the things we will talk about will pertain to client projects and how we manage them, how we actively build our client base, design decisions, and development practices and code tutorials.
We are getting ready to start a series on our next internal project that we are starting on where we will share our ideas, our methodologies, and even our screw-ups. We believe in being as transparent as we can. So, if you like those posts that 37Signals will do when developing an application, then stop on by and pick up a subscription to our RSS feed. If you are a subscriber of my blog here, I ask that you take a moment and subscribe to FAC’s blog as well. We have a lot to share and I have a lot of interesting code tips and pieces to share as well.
When you do pick up our RSS feed, please leave us a comment on any of our posts letting us know what you’d like to learn more about and hear from FAC. I know it’s easier to not comment, but we really do want to get to know our readers. So this is me calling you out to leave a comment – at least just say ‘Hi’. Cheers!
Posted over 2 years back at Mike Mondragon
Here is a screen shot of my current environment for programming Rails.

Layout
I’m on Linux and using Gnome as my desktop. On the left hand side is a gnome terminal with autotest running and on the right hand side is gvim. Notice that gvim is split into two horizontal windows the upper is dedicated to the functional code and the lower is dedicated to spec/test code. btw, I’m also using tpope’s rails.vim plugin in gvim as well.
I learned this particular style of having autotest and gvim with functional and testing code all viewable in one location from Eric Hodel Its great, everything is in one place, autotest gives immediate feedback when I’ve broken my code and my functional code and testing code are viewable together.
script it
I wrote a script called railsvim that when called with a rails project directory will open the gnome terminal and gvim in this configuration centered on my desktop. That way I don’t have to place and size all the windows by hand saving me time, e.g.
railsvim ~/projects/superfu
The script is hosted on
gist if you like to copy it:
railsvim . Looking at a copy of the script below you will find that that gnome terminal is opened with three tabs, one for script/server, one for script/console, and one for autotest which has focus by default since its last tab created.
#!/bin/bash
DIR="${1}"
if [ ! -d "${DIR}" ]; then
echo "call me with a directory, e.g.:"
echo "${0} /some/path/to/dir"
exit 1
fi
gnome-terminal --geometry=130x35+345+250 \
--window --working-directory=${DIR} -t "script server" -e "ruby script/server" \
--tab --working-directory=${DIR} -t "script console" -e "ruby script/console" \
--tab --working-directory=${DIR} -t "autotest" -x autotest &
gvim -c ":wincmd s" -geometry 120x60+1285+0 ${DIR} &
You’ll have to play with the geometry settings for the gnome terminal and gvim to customize the placements for your desktop.
resources
My railsvim script:
Hacking/automating the Linux desktop with wmctrl and others:
tpope (“TextMate may be the latest craze for developing Ruby on Rails applications, but Vim is forever”) rails.vim plugin for powerful vim and rails coding integration
If you have textmate envy here’s how to turn your gvim into a ghetto with their kind of font:
Posted over 2 years back at Rails Envy - Home
Episode 81. We're joined this week by the awesome Corey Haines. This podcast is chock full of news and awkwardness. We do apologize for the sound quality this episode -- my one mic had a bit of difficulty picking up 3 people and keeping the levels consistent. Hope you like it!
Subscribe via iTunes - iTunes only link.
Download the podcast ~20:00 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader

Want to Rejuvenate your legacy Rails application? Call Mocra as your first-choice team, led by Dr Nic. Mocra loves code, loves users, and they want to help you. Mention this advert to qualify for our largest discount consulting rate immediately. Check out Mocra.com for more info.
NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. They also recently produced Rails Lab, which gives you expert advice on tuning and optimizing your Rails app.
Show Notes
<object height="525" width="660"><param></param><param></param><param></param><embed src="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1" height="525" width="660"></embed></object>
Posted over 2 years back at Rails Envy - Home
Episode 81. We're joined this week by the awesome Corey Haines. This podcast is chock full of news and awkwardness. We do apologize for the sound quality this episode -- my one mic had a bit of difficulty picking up 3 people and keeping the levels consistent. Hope you like it!
Subscribe via iTunes - iTunes only link.
Download the podcast ~20:00 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader

Want to Rejuvenate your legacy Rails application? Call Mocra as your first-choice team, led by Dr Nic. Mocra loves code, loves users, and they want to help you. Mention this advert to qualify for our largest discount consulting rate immediately. Check out Mocra.com for more info.
NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. They also recently produced Rails Lab, which gives you expert advice on tuning and optimizing your Rails app.
Show Notes
<object height="525" width="660"><param></param><param></param><param></param><embed src="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1" height="525" width="660"></embed></object>
Posted over 2 years back at Rails Envy - Home
Episode 81. We’re joined this week by the awesome Corey Haines. This podcast is chock full of news and awkwardness. We do apologize for the sound quality this episode — my one mic had a bit of difficulty picking up 3 people and keeping the levels consistent. Hope you like it!

Subscribe via iTunes – iTunes only link.
Download the podcast ~20:00 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader

Want to Rejuvenate your legacy Rails application? Call Mocra as your first-choice team, led by Dr Nic. Mocra loves code, loves users, and they want to help you. Mention this advert to qualify for our largest discount consulting rate immediately. Check out Mocra.com for more info.

NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. They also recently produced Rails Lab, which gives you expert advice on tuning and optimizing your Rails app.
Show Notes
<object width="660" height="525"><param name="movie" value="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="660" height="525"></embed></object>
Posted over 2 years back at Rails Envy - Home
Episode 81. We’re joined this week by the awesome Corey Haines. This podcast is chock full of news and awkwardness. We do apologize for the sound quality this episode — my one mic had a bit of difficulty picking up 3 people and keeping the levels consistent. Hope you like it!

Subscribe via iTunes – iTunes only link.
Download the podcast ~20:00 mins MP3.
Subscribe to feed via RSS by copying the link to your RSS Reader

Want to Rejuvenate your legacy Rails application? Call Mocra as your first-choice team, led by Dr Nic. Mocra loves code, loves users, and they want to help you. Mention this advert to qualify for our largest discount consulting rate immediately. Check out Mocra.com for more info.

NewRelic provides RPM which is a plugin for rails that allows you to monitor and quickly diagnose problems with your Rails application in real time. They also recently produced Rails Lab, which gives you expert advice on tuning and optimizing your Rails app.
Show Notes
<object width="660" height="525"><param name="movie" value="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BVgM7qeAlko&hl=en&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="660" height="525"></embed></object>