Allan & Steve are the chubby founders of LessEverything. This is their blog, hear them rant, praise, give advice and talk about Just Stuff, Less Accounting, Lovd by Less, More Honey, Less Memories, Code, Business, Design, Marketing
February 21st, 2008

Chasing Rabbits

written by Steven Bristol

There are a lot of people who are really good programmers who never reach that “top .1%,” or whatever, level. Of late I have been thinking of one of the things that sets the best programmers apart: Discernment. I’m not talking about discerning a good technology from a bad one, but rather the ability to discern a good choice from a bad one. To be able to see the consequences of this path versus that one. In short, to know which rabbits to chase.

When writing software we face a million billion choices every day. Having the talent to make good choices is crucial to being productive. It’s the reason we can launch a product in seven hours.

Here is an example: Recently, one of my guys was refactoring some bad controller code we inherited. He was very excited to show me how he had abstracted and cleaned some of the bad controller code into a library so all of the controllers could call these methods instead of duplicating this bad code all over the place. At first glance it was clear to me that this abstraction was the beginnings of a new library that would be almost identical to Make Resourceful. Once I showed him where his path was leading he agreed that this was probably not the right time to write a Make Resourceful clone, especially when what was really called for was just making the bad code proper, not writing a support structure for it. This reminds me of what Malcom Gladwell was talking about in Blink: The ability to know instantly. (Perhaps to know truth instantly.)

I’m not talking about syntax here. Obie Fernandez and I have fairly different coding styles. He prefers to have the code be more explicit and readable while I prefer my code to be more terse and succinct. Neither is right or wrong, and neither is the reason we are both able to look at a problem and immediately prune it to its core and see clearly where the different paths take us.

This isn’t just true of code, I have seen Allan do the same thing with design. We were working with a designer who was very headstrong and really thought Allan was lacking in something (I’ll save the “why were you working with someone like that” story for another time). This person was doing the html/css for a website and using some popular grid-css-template-thing (I believe that is the technical term for it). When Allan first looked at the code, he just started ripping parts out, not because it was bad in and of itself, but because it was clear that was way too complicated. Using this framework did not buy the simplicity and maintainability of what has come to be known as “The Allan Way™.” (It is amazing to watch Allan take a 7000 line css file and without changing the way the site looks, trim the file to 300 lines.) The other designer made a fuss until Allan was done. Once he saw the difference, he was converted to “The Allan Way™.”

It’s easy to say, “that is just a product of experience.” And although experience certainly plays a part, I think it goes way beyond that. I think this discernment might also be called wisdom. Wisdom basically boils down to how well can you predict the future. When one approaches the wise old sage, the sage immediately knows the outcome of all the paths presented.

So how does one get this discernment/wisdom? I am not sure. I do believe one can learn it, and I think one of the requirements is to know that that is what one is trying to learn. When you play chess, do you only think about your strategy, or do you constantly think “why did my opponent make that move?” Acquiring wisdom might require applying that mental discipline to every part of life: Why did my wife/boss/client/adversary say that? Was it planned or just careless? How does my action affect others? And not just in dealing with others: If I do this, what will I do next? And then what? What paths am I forcing myself into later, if I make this choice now? How deep is this rabbit hole?

Maybe this is the difference between success and mediocrity, between satisfaction and melancholy. Or maybe not.

February 19th, 2008

Haml doesn't like javascript

written by Steven Bristol

We have been going back and forth on Haml lately. There is no doubt that it is nice, it is short, tight and does a lot for you. At the root of haml is yaml, a format for storing data. In yaml (and consequently in haml) indenting is very important, and for this reason haml and javascript go together like oil and grape jelly.

To haml, javascript is just plain text, which means to make haml happy all of your lines of javascript code must allign vertically. Here is an example:

In html:
<script type="text/javascript" charset="utf-8">
//<![CDATA[
jQuery(function(){
  tog("#forgot_password_clicker", "#login_form");
  tog("#forgot_password_clicker", "#forgot_form", forgot_text);
});
function forgot_text(){
  if (jQuery("#forgot_text").html() == "forgot")
    jQuery("#forgot_text").html("remember");
  else
    jQuery("#forgot_text").html("forgot");
}
//]]>
</script>
In haml:
%script{:type => "text/javascript", :charset => "utf-8"}
  //<![CDATA[
  jQuery(function(){
  tog("#forgot_password_clicker", "#login_form");
  tog("#forgot_password_clicker", "#forgot_form", forgot_text);
  });
  function forgot_text(){
  if (jQuery.trim(jQuery("#forgot_text").html()) == "forgot")
  jQuery("#forgot_text").html("remember");
  else
  jQuery("#forgot_text").html("forgot");
  }
  //]]>
A few things to note:
  1. Javascript becomes much harder to read and write.
  2. Textmate does not do syntax highlighting on the javascript.
  3. The haml requires the jQuery.trim() method in the first line of forgot_text() function because with haml you need to add a bunch of white space:
  4. If you’re going to output ruby variables into your javascript, it only gets worse.
html:
<span>I <span id="forgot_text">forgot</span> my 
  <a href="javascript:void(0)" id="forgot_password_clicker">password or username</a>
</span>
haml:
%span 
      I 
      %span#forgot_text
        forgot
      my 
      %a{:href => "javascript:void(0)", :id => "forgot_password_clicker"} password or username 
There are things one can do to overcome this:
  1. One could use :plain and then indent javascript.
    • The problem is doing that means one can’t render ruby variables to the javascript.
  2. Write unobtrusive javascript.
    • Nice, but I really like to cheat.
  3. Put all of your javascript in partials
    • Sorry, I just threw up in my mouth a little bit.
  4. Patch haml.
    • Let me know when you do this.
  5. Stop writing javascript.
    • I also think you should start using frames again.
  6. If anyone knows of any other way around this, please let me know. We’d love to use haml, but not at this price.
  7. Don’t use haml.
    • Our choice for today. Although we will review this regularly.
February 12th, 2008

Cheat Sheets just got a lot better

written by Steven Bristol

For those of you who do not use Cheat Sheets, you should.

For those of you that do, they just got better. There is now an auto complete for bash. You can find it here

Text:
sheets=`cheat sheets | grep '^  '`
function complete_cheat {
  COMPREPLY=()
  if [ $COMP_CWORD = 1 ]; then
    COMPREPLY=(`compgen -W "$sheets" -- $2`)
  fi
}
complete -F complete_cheat cheat

Here are the instructions:

  1. Open terminal.
  2. cd ~
  3. Copy this text into your .bash_profile file.
  4. Either restart your terminal or run source .bash_profile
  5. Type cheat str(TAB)
  6. Cool huh?
January 14th, 2008

Why not to leave your job...

written by Allan Branch

Most people talk about how great being your own boss is. How great working from home is, how wonderful and rewarding is. Well it can be, sometimes. This isn't a rant, I love working for myself, this is a forewarning to others about the challenges you'll face.

Here's a few reasons working on your own and being your own boss stinks.

  • No boss to complain about, no more complaining about your boss, you're the boss.
  • There's no one to blame when there's no work, you must be proactive about getting projects.
  • Like being alone? There's no one to talk to during the day except your pet, if you're busy you'll be isolated in your house. This only sounds enjoyable for a few weeks.
  • Like sleeping in? No boss telling you to get your work done. You have to be self-motivated, procrastinators beware. Missing a deadline and losing a client isn't a good thing.
  • Like talking to clients? There's no one selling, talking to the clients. You must constantly be looking for the next check, project and client.
  • There's no one doing the accounting and making sure you're paid. Have you made bill collecting calls before? You will!
  • Because there's no salesmen or accounting department. You will be doing your skill set less, if you're a designer you will be lucky to be designing 60% of the time now.
  • Enjoy weekends? Get ready to work 60+ hours a week. More if you want to continue to be your own boss.
  • Don't get sick, you won't have health insurance, get ready for that battle.
  • Don't get sick (#2), you won't get paid if you take a day off. You don't work, you don't get paid.
  • If you are very successful, you will have to hire people. Hiring people sucks. How do you pick the right person? Good luck.
  • If you hire people then they are doing the fun stuff and you are spending your time selling and talking to clients.
  • If you hire people you will also have to fire people. That is never fun.
  • Having a business partner can be a great help. It also means you have to get permission before wiping your butt. (I checked with Steve before writing this.)

*Steve added a few of these, he's been slacking on his blogging. I let him add on my post so he feels better about himself.

Have anything to add? Post it as a comment.
December 20th, 2007

Globalize Translations Admin Screen

written by Steven Bristol

If you are using Globalize (which we recommend) and you have created an admin screen so your client/French product manager can edit the French entries, make sure you call

Globalize::Locale.translator.cache_reset
after the model.save, otherwise you’ll have to bounce the app to see the changes.

Don’t even entertain the idea of giving your client/French product manager the ability to bounce the app to see the changes. :)

December 13th, 2007

Fired From an Open Source Project? Oh Yes!

written by Steven Bristol

What’s happened so far:

  1. Yesterday, a member of the open source project MooTools, Olmo Maldonado, posted an inflamatory video criticizing jQuery and Prototype, on the MooTools blog.
  2. Soon after, John Resig, the creator of jQuery, posted a response (response contains the video).
  3. People on the interweb (including me) have been fueling the flame war all day long.
  4. The creator of MooTools, Valerio Proietti, just took down Olmo’s post and blogged a very nice apology that will hopefully put the fire out.

Here is the really good part:

(Quotes from Valerio’s post):

“Olmo’s lack of maturity, even for his age, always was notable…”

“Olmo is no longer a part of the Mootools development team. We wish him well, but frankly we can’t tolerate his immaturity any longer.”

Olmo was fired from an open source project!!

Now I don’t mean to hurt the guy, I feel for anyone who has been fired. But just think about this: Letting you commit now costs the project more than your contribution is worth. Even though your contribution didn’t cost anything. I’ve known people who are “negative productivity.” They not only produce nothing, but the also take up other people’s time in the efforts to produce, but I’ve never heard of this.

I don’t blame Valerio, I’m sure he did what he thought was right and just, and I am in no position to say he did the wrong thing. I don’t know all parts of this story and can’t see into his heart, so I mean no malice or judgment towards him.

As a resident loud-mouth/instigator/f-bomb advocate I am just shocked and surprised….

December 11th, 2007

Bash Tip

written by Steven Bristol

Try this:


> ls -al
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21 
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> !!
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21 
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> ls -al
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21 
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> ls !$
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21 
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
So:
  1. !! reruns the last command (very useful if you forget to put sudo in front: > sudo !!).
  2. !$ gets the first param of the last command.
December 5th, 2007

Ruby 1.9 (yarv) is Almost Here....And it's Fast

written by Steven Bristol

Check out this speed comparisons

The next version of Ruby (1.9) and it’s VM (YARV) are expected to be a Christmas present to us all. The only question remaining is “Will Rails 2.0 support it?” I don’t know the answer, but I do know the core team is aware of this and has been doing “stuff.”

November 28th, 2007

Setting up SSL on Nginx

written by Steven Bristol

This article has the instructions for setting up an ssl website on nginx using Godaddy certificates.

(Text duplicated here for my sake)

  1. Purchase a GoDaddy Turbo SSL (this was pretty straight forward – it could be a lot easier if they would stop upselling everything)
  2. When downloading your certificate, choose the apache server (if you choose other, you will not get the GoDaddy cert in the download)
  3. When you download the cert, you will have two certs – yours and one called ‘gd_intermediate_bundle.crt’.
  4. Create a new file where you will combine the two certificates, I called mine ‘combined.crt’
  5. Paste the contents of your certificate in the new file, then paste the contents of the GoDaddy certificate after yours.
  6. Upload the combined cert to your server
  7. Update your nginx.conf to use the combined certificate: ssl_certificate /etc/nginx/certs/combined.crt;
November 22nd, 2007

Run IE on Your Mac Without Parallels

written by Steven Bristol

It’s no secret that I am not a fan of Parallels. I consider it a necessary evil. We need it because we have to test in IE, but it is crash prone and the networking stack feels like it’s still in beta. People have told me that version 3 is much better than version 2, but I feel like that is rewarding them for writing bad software, so I have not bought an upgrade (although I have bought three licenses for version 2 before 3 was out).

Anyways, I just discovered a really easy and cool way to run IE on my Mac without Parallels…..ies4mac is awesome. It’s easy to install and it works great. Give it a try.

November 18th, 2007

Steve at RejectConf

written by Steven Bristol

The video of my three minute thirty-two second presentation of Less Js Routes is now online. You can find it here. (Go up a directory to see all the talks.)

November 18th, 2007

Installing the MySql Gem on Redhat Linux (CentOS)

written by Steven Bristol


> sudo yum install mysql
> sudo yum install mysql-devel
> sudo gem install -y mysql -- --with-mysql-config=/usr/bin/mysql_config
November 16th, 2007

Textmate Search (grep) in Folder Updated

written by Steven Bristol

If anyone download the Textmate bundle I mentioned here, Yehuda just updated it. Go get the bug fixes.

November 12th, 2007

Yehuda Updated Grep in Projects (Textmate)

written by Steven Bristol

You might recall a previous post where I talked about a Texmate bundle put out by Yehuda Katz that allows you to grep in project in Textmate.

Well, Yehuda has updated the bundle. Enjoy!

November 1st, 2007

Accept Your Destiny, its Google Gears

written by Allan Branch

I recently attended an Internet Professionals Society of Alabama (IPSA) meeting. Yes we have the internet in Alabama and even "horse-less buggies" known as cars. Dimitri Glazkov spoke about html5 and Google Gears. In summary, html5 blah blah, Google Gear, yippie hooray!

Google Gears integration seems to be the destiny of any web app of the future. Star Wars Quote: "You cannot escape your destiny". Gears can provide offline usage of web apps, less server resources used and faster loading times! For us not so nerdy types, what is Google Gears? Google Gears inserts a small local host between you and your browser and the app can talk to it instead of the production server. Gears is used to store data temporarily instead of constantly polling the server for information and even allowing the app to working offline. For the designers reading this constantly polling a server is bad. :(

You ask, "So Allan, what's the bad side of Google Gears?" Well some important data might be saved locally and that could be a security risk if a malicious party accesses the machine. But as a whole, the presentation Dimitri prepared got me all hot and bothered, which is the same feeling I get from an Apple Store.

Check out Dimitri’s blog and presentation.