Archive for September, 2008

19
Sep
08

NTS: id xhtml attribute

 <td id="text_data">  <- Bad
 <td id="data">  <- Good

If you store a record’s Id into an xhtml id attribute, store it directly and don’t decorate it with any text, especially when the text is only a decoration.

This obviates the need to do javascript substring manipulation when you need the number.

Cheers!

19
Sep
08

NTS: Benchmark.measure

$> script/console
>> require 'benchmark'
>> result = Benchmark.measure { [your stuff here] }
>> puts result
>> xxx / 60

Divide the last number printed (the one in the parentheses) to get a rough idea of how many minutes the operation took.

I’ve had to, on a couple of occasions, fire of script/console in production and massage some data, basically apply some business logic on some Models. Sometimes this process can take a while, so, in order to provide some idea of the length of execution I can now execute this in my development environment and the staging environment.

You can also use this in scripts that you may use with script/runner.

Cheers!

07
Sep
08

Six Months as a Freelancer…

Come celebrate with me! This week marks six months as an Independent Consultant. And in that time here’s what I’ve worked on:

  1. A sports-based social networking site (Rails)
  2. A job search site for doctorate holders (Rails)
  3. A site to manage and display digital assets for a library (Rails)
  4. A web-based application to manage an organization’s HR roles and levels (PHP)

And here’s what I’m currently working on:

  1. A site to manage progress for a home-schooling methodology (Rails)
  2. A site used to run a Tutoring business (Rails)
  3. Converting PHP applications due to a company-wide database migration effort (PHP)

I’ve been busy and, thankfully, I’m still busy. I have to be honest, I’m still learning how to be a Great Freelancer. It hasn’t been all roses and champagne. But I wouldn’t change a thing.

Lessons learned (and still learning) so far:

  • Working from home still requires structure
  • There’s no such thing as Too Much Communication
  • Honesty Pays
  • I need Socialization; get out of the house
  • Stay on top of your business chores
  • Keep healthy habits; noone does your work when you’re sick
  • Have Fun

I’ve been pretty fortunate to have been able to last as long as I have. I still need to learn how to: a) create a pipline, and b) keep it filled. Doing good work is one way. And I’d like to believe I’ve been able to do that. I also feel fortunate to be surrounded by a large group of successful entrepreneurs. Which compliments my natural curiosity and endless questions! :-D

I know I have a lot more to learn, but I’m eagerly looking forward to the next six months.

Cheers!

05
Sep
08

NTS: Note To Self…

And my intent is to leave myself notes. Notes on things I find along my software development travels or system admin travels or what ever. And if you find them helpful, so much the better. I’ll start each entry with NTS: so you can quickly see what the entry is going to be about. My hope is the entry will be better then a glorified link list. Yes they’re good too, but, other then the fact you’ve listed them, why are they important to me. Just so you know, NTS entries will be important to me and might be important to you.

I already have a couple queued up so look for them soon (like in the next week).

Cheers!