subdomains using webrick (script/server)
run this in the terminal:
- mate /etc/hosts (or vi /etc/hosts if you don’t have textmate)
- add “127.0.0.1 <SUBDOMAIN>.localhost.local” to your /etc/hosts
- save
- boot webrick by typing script/server
- navigate your browser to http://<SUBDOMAIN>.localhost.local:3000
done.
Earlier I ran an errand and while I was driving I had a thought and remember thinking “I need to look that up when I get home”. I got home, did a few things, ate dinner and just a minute ago, I realized I wanted to look something up. I have no idea what that something is, but I know there is definately a something floating around in my head somewhere that needs to be researched. Right about now, I’m thinking it would be cool if google could actually read my mind, then I could just go to google and type “That Thing I Was Going to Lookup”.
For years I’ve been working in languages that are loaded with “punctuation”. Semicolons, parenthesis, curly braces are just everywhere. Between C#, JavaScript and CSS, I think I reach for the opening and closing curly braces more than any other key on my keyboard. I recently decided to learn Ruby on Rails 1 and have found the sparse use of curly braces, parenthesis and other puctuation in Ruby is a refreshing change compared to what I’m used to. With the built-in CoffeeScript support in rails I’ve also seen that I can have the same thing for my javascript.
I may go into CoffeeScript in more detail at a later date, but for now I’ll just point out that CoffeeScript is a language that compiles into javascript, and offers a cleaner and more succinct syntax so it is easier (and more fun) to write. An example is the fastest way to illustrate the point. Using the test console right on the web site, I wrote a simple piece of code that looked like this:
multiples = (num * 2 for num in [1..10])
alert m for m in multiples
And it compiled into this:
var m, multiples, num, _i, _len;
multiples = (function() {
var _results;
_results = [];
for (num = 1; num <= 10; num++) {
_results.push(num * 2);
}
return _results;
})();
for (_i = 0, _len = multiples.length; _i < _len; _i++) {
m = multiples[_i];
alert(m);
}
Which one would you rather write? That’s what I thought! Go check it out
-
I plan to write more about my experience and resources I found helpful in learning Rails when I have gotten a little further into the process. ↩

