CSS, Ruby, and breaks, oh my!
Posted on December 16, 2008, under Startups.
Today’s the 16th. I haven’t worked on YoDino since the 12th. Egad! What happened?! The usual “startup stress” happened.
I’ve been working pretty hard on getting the last important bits of YoDino implemented before Christmas. On the 11th, I started styling the app. On the 12th, my penchant for well-thought-out, structured, and predictable languages (<cough>Ruby</cough>) caused me to throw my hands in the air in frustration with CSS.
CSS…What an AWFUL language!
There, I said it. I don’t care if you can do awesome things with it, like CSS Zen Garden. Technically, you can do awesome things with Delphi and BASIC and ASP.NET, too. But I don’t do things with Delphi, BASIC or ASP.NET..and for very good reasons! [1] The same should apply to CSS, but there’s no alternative. Ugh.
Okay, tangent’s over. The frustration I felt from CSS was really blown out of proportion, but I think that’s because I’m doing this startup alone. It’s pretty much a fact that startups with multiple co-founders fare much better than startups with a single founder. Co-founders are able to discuss problems and ideas with each other, share frustrations, motivate each other, etc. They’re essentially a small, tight family.
I reckon my frustrations with CSS ended up being the straw that broke the camel’s back. I needed a break. So, you know what? I bloody well took one! [2]
Now, a couple of days later, I feel refreshed and ready to tackle it all again. And this time, I’m going to succeed. And CSS is going to be my bitch, not the other way around.
[1] If you have to ask why I don’t do things with Delphi, BASIC, or even ASP.NET, you’ve never experienced the clarity and melancholy of working in Ruby. Go try it. If, after a couple of days, you can honestly come back to me and say that you didn’t soil yourself from pure pleasure, I’ll buy you a beer.
[2] Yes, I know that once I launch YoDino, taking a break won’t be possible. But that’s okay! I’ll have made it through at least the first dip by then, and things will be different.
+1 for the thought, -10 for the execution
Posted on December 13, 2008, under Other.
I just received an email from the anti-virus company ESET, reminding me that a license that I purchased for one of their products is coming up for renewal soon. I appreciate the email, but honestly, do you think they could’ve put some more time into formatting it and making it readable and appealing?
Scanned by NOD32 ( http://www.eset.com.au )
and NetBox Blue ( http://netboxblue.com.au )
There isn’t a single newline in the message…WTF?
Rails Resources: :as vs :controller
Posted on November 15, 2008, under Coding.
As you may or may not know, when configuring routes and resources in config/routes.rb , you can pass the :as or :controller options to map.resources . When I first read about these two options in the Rails Routing From The Outside In Rails Guide, they seemed to do the exact same thing.
However, that’s not the case at all.
map.resources :photos, :as => 'images'
This allows you to request the “photos” resource using the word “images”. IE: http://localhost:3000/images/ would route to the “photos” controller.
On the other hand,
map.resources :photos, :controller => 'images'
This allows you to request the “images” resource using the word “photos”. IE: http://localhost:3000/photos/ would route to the “images” controller.
Simple? Yes. Subtle? Yes.
Convention and reasoning
Posted on November 11, 2008, under Coding.
When coding in the past, I rarely used the switch/select/case-conditional. However, since I started using Ruby, I’ve found it to be quite useful in some situations.
Vim formats them like this:
case foobarwhen 'something' # Do something.when 'another thing' # Do another thing.else # Do this if the above "when"s don't match.end
That indentation scheme doesn’t feel right to me. The “when” and “else” clauses are pretty much children of the “case” clause. In my opinion, “when” and “else” should be indented +1, like this:
case foobar when 'something' # Do something. when 'another thing' # Do another thing. else # Do this if the above "when"s don't match.end
But now the code within each “when” and “else” is indented +2! That’s a lot of indentation.
I brought this up in #ruby-lang on Freenode. A couple of people agreed with me, a couple didn’t care, and the rest disagreed. There was one poignant comment though:
<quix> litage: why doesn't your reasoning for if/elsif apply to case/when?
I haven’t been able to answer that yet. quix’s reasoning is sound, but I can’t shake the dirtiness that I feel when indenting “when” and “else” to the same level as “case”. It just feels wrong…
Joining the military
Posted on October 25, 2008, under Other.
Last night, I had a dream that I was joining the military. It was one of those dreams that’s so real, you can’t tell that you’re in a dream…I was sh*tting myself.
What’s ironic is that, back in university, I applied to join The Canadian Forces as a Combat Engineer. I ended up not pursuing that, because a) I didn’t want to learn how to kill people, and b) adventuring around Australia sounded like a whole lot more fun. Oh, and Black Hawk Down was released after I’d started my military application, which gave me a dose of reality and what war can be like.
The scariest part of the dream wasn’t that I was joining a military, but that I was joining the American military…and being shipped off to Afghanistan or Iraq. *shudder*
Idiots and Angels
Posted on October 18, 2008, under Other.
I went to see the movie Idiots and Angels at the Toronto After Dark Film Festival today. The animation style was amazing, and the movie was pretty good, too. Check out the trailer:
Longing.au
Posted on October 14, 2008, under Other.
I’m reading Jupiter’s Travels right now. It’s about a guy who motorbiked 63,000 miles (that’s over 100,000km!) around the world…starting in 1974! His recounting of biking in Australia really made me miss Australia.
I miss the sun and warmth, the laid-back approach to life, the friendliness of most people, and of course the lizards, echidnas, and wombats. I even miss the spiders.
But I have to accept that I’ve decided to live and work in Toronto for now. As much as I love Australia, it’s not where I should be at the moment.
So as Chopper would say, “Harden the fuck up, Nick!”
PS: Matt, thanks for that HTFU reminder.
Hypothesis: Toronto is bad for my health
Posted on October 11, 2008, under Health.
I spent 3.5 years in Australia. During that time, I was only sick twice. I’ve been back in Toronto for six months, and been sick (IE: sore throat, runny nose, etc) three times.
I can think of two possible explanations:
1) Toronto’s environment is dirtier and makes me more prone to getting sick;
2) I’m under more stress in Toronto.
#1 is definitely true in comparison to pretty much all of Australia, except for areas near mines and other heavy industry.
#2 is possible, but I don’t buy it. There were many times that I was under a ton of stress while working at Voxpak in The Gold Coast, Australia.
Thus, my hypothesis is that Toronto is bad for my health.
ModelSpeccer Released!
Posted on October 10, 2008, under Coding.
Yesterday I released my first open-source project. It’s called ModelSpeccer, and it generates RSpec specs on-the-fly for Rails model attributes. It started out as part of my housing rentals website, and eventually grew into a separate module. Once that happened, I figured I might as well learn how to write a Rails plugin, and published it on GitHub. Have a look:
http://github.com/nickhoffman/modelspeccer/
Encouragement
Posted on August 5, 2008, under Parkour.
Most of you know what parkour is. If you don’t, in one sentence, it’s about using your body and environment around you to move from one location to another as quickly as possible. Here’s some more info:
I started training on and off in Australia around the middle of 2007. When I moved back to Toronto in March 2008, I began training with PKTO (Parkour Toronto).
Unfortunately, it seems that I’m a bit prone to injuries. From parkour alone, I’ve punctured the same shin twice, sprained an ankle a couple of times, bashed my knees many times, and received the usual cuts and scrapes that come with the territory. Two weeks ago, I also crashed while riding my bicycle. That was NOT pretty, and it did a number on knee. And the second shin puncture occured two weeks before the crash. Ack.
So for the past month, I’ve been healing rather than training. Healing sucks. I mean, it’s great beacuse it’s getting you closer to being able to train again, but the fact that you can’t train…at least, not train “fully”…sucks.
Yesterday evening I got back into training. However, while I was healing, there were times when I was pretty unmotivated and down. I felt like I was making no progress: I’m always injured, what’s the point?, etc. But I slowly realised that there are things you can do to keep yourself motivated while healing.
First of all, train other parts of your body. My knee was giving me grief, so I started working towards 100 push-ups. If you hurt, say, your shoulder, work your abs and legs. Also, stay involved in the community. Go out to meet-ups even if you can’t train. It’ll keep you motivated and looking forward to when you can train again.
Another thing you can do is stretch and do research. Videos abound explaining technique, conditioning routines, etc. Do some homework and develop a routine for the time that you’re recovering, and tweak your usual training regimen.
It’s all about making the best of the situation that you’re in. Yeah, it sucks to be injured. But accept it when it happens, and modify your training to fit in with your predicament. If you do that, you’ll be pleasantly surprised when you get back to your regular training.