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
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.
October 30th, 2007

Did Apple Pull a Vista?

written by Steven Bristol

Leopard/Vista:

Similarities:

  • Both shipped late.
  • Both dropped features before shipping.
  • Both are buggier and less stable than their predecessors.

Differences:

  • Vista took WAAAYYYYY longer to ship than Leopard. And at least we got the iPhone as an excuse from Apple.
  • Leopard dropped relatively minor features. Vista dropped everything except the glass.
  • I don’t think I’ll be downgrading to Tiger, although a lot of people are downgrading to XP.

So no, I don’t think Apple pulled a Vista. But a few more slips and they might have.

What’s missing from Leopard:

  • In the betas Time Machine could backup over the network through an Air Port Extreme. Not in the final. This one is huge for me, I actually bought an upgraded Air Port Extreme just for this. It’s still unopened in the box and will be returned. Once Apple releases a patch, I’ll buy it again.
  • No Java 1.6. Not such a big deal for me, but Apple is way behind in JVMs. Until Shoes allows Ruby to replace Java, I think we should have the latest JVM.
  • Since Friday I have had about one freeze (forced restart) a day. Far from acceptable. I can hardly wait until the first update. Even my local Mac Genius said he never installs the new OS at his house until the first patch is out.

Over all I think Leopard is awesome. Since we all work remotely, the screen sharing in the new iChat alone, is worth the upgrade. I recommend everyone upgrade. Even with these problems I think it’s worth it.

October 25th, 2007

"invalid label" Error When Eval JSON

written by Steven Bristol

If you are getting an “invalid label” error when doing eval() on a json string, here is the solution:

You must do eval(‘(’ + jsonObj + ‘)’) to fix this. I know this seems really stupid, but http://www.json.org/js.html shows just this same example.

I wrote a function to handle this:

function jeval(str){return eval('(' +  str + ')')}

and then I call jeval() instead of eval();

October 24th, 2007

Named Routes in JavaScript

written by Steven Bristol

Have you ever wanted to use named routes in your JavaScript? So have I. Now you can.

I just released a plugin that will generate a JavaScript file with functions that give you the path to the route and functions that will call these routes using ajax.

You can find it here:

http://code.google.com/p/lessjsroutes/

October 23rd, 2007

Firefox CSS Bug

written by Steven Bristol

If you do
overflow: auto;
on a tbody tag, then firefox will ignore any z-index on that tag or its children.
October 17th, 2007

Note to Self

written by Steven Bristol

IE does not like nested forms…..(Even if they are buried inside partials.)

October 5th, 2007

RubyJax is Born - Nov. 15

written by Steven Bristol

Mark your calendars, the first installment of RubyJax will be happening in Jacksonville on Nov. 15 at around 6:30 PM at Team Gaia’s place at the beach (map).

Here is some info:

  1. This is for everyone in or around Jacksonville, Florida. Or anyone willing to get here for the event.
  2. You don’t have to be a geek to come, fonzies and wannabes are welcome.
  3. No Ruby or Rails experience required.
  4. This first event will be a meet and greet, be prepared to: (1) talk about yourself, and/or (2) listen to others talk about themselves.
  5. We will have a surprise guest (you’ll be surprised and disappointed).
  6. There either will or will not be pizza.
  7. You will meet some really cool people (unfortunately Allan won’t be there).
  8. You will have fun, unless you are the type of person the doesn’t want to have fun, but just wants to make every one else miserable. Although, if you make every one else miserable, that might be fun for you.
  9. Topics will not be limited to Ruby or Rails, you are encouraged to talk about me as much as you like.

Please note that this list of information is not complete and more information is sure to follow. But since the whole rails community, and even Japanese rubyist will be talking about RubyJax, I’m sure you’ll hear the follow ups.

RubyJax.com is not up and running yet, but it will be soon.

October 4th, 2007

Rails 2.0 is on it's way. Are you ready?

written by Steven Bristol

Peter Cooper brings us this nice little tid bit to help < 2.0 apps get ready for the big change. This script aims to examine your rails app and figure out what you need to change to before migrating to rails 2.0.

Here’s how to use it:

  1. Copy the script into a file called “rails2.0.rb.”
  2. Move the rails2.0.rb file to the root of your rails app.
  3. Using the command line, execute the script with “ruby rails2.0.rb.”
  4. Fix your app!
September 27th, 2007

Rails RESTful Url Guide

written by Steven Bristol

Erine Prabhakar just put up a short guide to RESTful url formats in Rails. Anyone just getting into RESTful Rails, and that should be all of you not currently doing RESTful Rails, might enjoy this overview.

September 26th, 2007

Installing ImageMagick and RMagick on Mac OS X

written by Steven Bristol

I have found a new way of doing this that is so good I can’t believe I haven’t heard about this before. It turns out, there is a one click (command) installer for ImageMagick and RMagick and nobody is talking about it. If you go to the RMagick home page and look though the FAQ you will see the first choice is to use the installer script. Choices two and three both revolve around Ports, so we can all ignore those from now on.

Here is how to do it:

  1. If you already have ports installed with a version of ImageMagick, but not RMagick, you may have to remove the opt entries from your ~/.bash_profile or ~/.bash_login file.
  2. Go here and download the “rmagick-osx-installer.”
  3. You probably already have XCode installed, but do you have the X11 SDK installed? Probably not, because it is not installed by default.
    1. Go back to the XCode installer, either the one you downloaded or the one on the Mac OS X install disk.
    2. Rerun the installer, but this time when you are on the “Choose your installation type” (or something) screen of the install wizard, click the little “Customize” button on the lower left. I know, I missed it too the first time through.
    3. Make sure X11 SDK is select in one of the sub-folders (I can’t recall which one).
  4. UPDATE: Ignore this step if you are on Leopard. Make sure you have X11 also installed. Yes, this is different from the SDK. This page will tell you how easy it is to do that.
  5. Did the “rmagick-osx-installer” finish downloading and automatically unzip to a folder on your desktop called “rm_install-1.0.2 Folder?”
  6. Using (i)Term navigate to that folder and run: “ruby rm_install.rb”
  7. Did you get an error that says something like “The installation directory ‘xxx’ contains blanks. Some of the install scripts for the dependent libraries can’t handle directory names with embedded blanks. Please choose another directory.”
  8. I think this is probably the biggest reason why this installer is not more popular, I had no idea what this error meant. I had to look in the source code to figure out that the path to the rm_install.rb is not allowed to contain spaces (blanks). Then why did it unzip to a folder whose name has a space in it?
  9. OK, cd ../ && mv rm_install-1.0.2\ Folder rm_install-1.0.2 && cd – (Or: rename the directory so it has no spaces.)
  10. Run the installer again and it should automagickally install RMagick, ImageMagick, and all dependencies.

Now I know what you are thinking, “Steve, if you’re installing RMagick did you get a brand new computer?!” And the answer is sorrowfully no. But what I did have is my SECOND hard drive failure in six weeks. That means that this is my third hard drive on a computer that is less than one year old. And I am excited because I am sure I will have to reinstall all of my gems (including RMagick) and ImageMagick next month when Leopard comes out. Happy, happy, joy, joy. But at least I finally found the right way to do it!

September 14th, 2007

Regex Sensei is Here!

written by Steven Bristol

Chris has finally started his series on Regex.

September 7th, 2007

Please Read This Post In It's Entirety Before You Send Me Your Resume

written by Steven Bristol

A few days ago I posted an ad to hire a few more excellent “the Guys.”

Please notice I specifically state:

Please do not apply if:

1. You are compelled to send a resume.

Amazingly people keep sending me resumes. Let me ask you all a question: If someone can’t even follow that simple instruction, how in the world would they expect me to trust them with my code?

P.S. Allan suggested I post their resumes here, but I resisted.

August 30th, 2007

Hackilious

written by Steven Bristol

This is a righteous hack:

http://larrytheliquid.com/2007/03/18/validating-positive-with-infinity/

Until you realize that there is a hard limit to number size in the database. That attribute is stored in a particular number of bytes. And this hack does not take that into consideration.

So then you look in the database to see how many bytes make up the column and you start thinking that maybe this is the wrong direction? You’re not checking maximum number values anywhere else (except string lengths). So then you consider that maybe that is why rails makes an integer column 11 bytes by default, that is a really big number.

So then you start writing something like this (because you really need to make sure it is a positive number):

def validate
  errors.add(:price, 'must be positive') if self.price < 0
end

And then you think, maybe I should just use the hack….....

P.S. Consider your self a hard core hacker if at any time while readying this post you found yourself thinking “One man’s brilliant hack is another man’s language feature.” ;)
P.P.S. If you don’t know what the P.S. means, you should immediately start reading 2600 and go back and enjoy the original episodes of The Broken (wasn’t Kevin Rose a cute kid?)