Hello developers, how are you? Fantastic. Does your code look like mine? No. Could it load like mine? Yes. Should you use rack-gist to load your gists? I don’t know… Do you like not blocking your users while you page loads another Javascript file? Do you want code that looks like it could write your app for you in the dream computer it built for you with its own DWORDS? Of course you do. Recursive Hasselhoff! Into the best gisting of your lif...
Verbose Logging
software development with some really amazing hairsinatra-bundles 0.3.0 is out
Version 0.3.0 of sinatra-bundles is out and powering the blog for a week or so. It’s cold out there, so bundle up: % gem install sinatra-bundles require 'sinatra/bundles' Version 0.3.0 has a new feature and a slight API change. Custom path prefixes Yeah, I know, not everybody is as awesome as I am with their stylesheets and javascript files in the stylesheets and javascripts directories, but now you can control where they live on the disk. doc...
Read the full article
Most Dangerous Programming Errors, 15-11
It’s been a while, but I’ve been busy pwning n00bs at Modern Warfare 2 and Bad Company 2, and buying a car, so life has been pretty busy as of late. Have no fear though! I continue the look at the Top 25 Most Dangerous Programming Errors with numbers 15 to 11. 15. Improper Check for Unusual or Exceptional Conditions When you ASSUME things, you make an ASS out of U and ME. This is all about assumptions. You assume something will work, you ass...
Read the full article
Find queries missing indexes in your Rails application
Rails developers aren’t exactly known for getting their indexes right (or even at all) on their databases. Granted, databases are a tough subject, and some people and companies make their living dealing with only databases, and some only with one database (like MySQL or Oracle). If you coming to web development with no formal background in databases, and it’s all new to you, then it’s totally understandable to maybe forget about indexes initia...
Read the full article
Getting rid of transactions for the poor man
A quick post for today. Want to get rid of transactions from ActiveRecord for something? Here’s a cheap way to do it. It only works for MySQL obviously, but you can roll your own if you are on postgres. I’ll make it a bit less crappy and make it a gem or something.
Read the full article
sinatra-bundles 0.2.0 is out
I pushed up a new version of sinatra-bundles and it’s running smoothly on my blog here, so I best tell you about it. First, get your bundle on: % gem install sinatra-bundles require 'sinatra/bundles' Version 0.2.0 has a couple fun things. The sinatra dependency is bumped up to 1.0, since it’s out (yay!), it’s more awesome, and I’m not quite sure if the bug that prevented me from using earlier sinatra was fixed or not in the 0.9.6 release. etag...
Read the full article
sinatra-bundles plays nice with eval
I recently added a Javascript file to my bundle with sinatra-bundles that uses Javascript’s eval functionality. The call to eval executed code that referenced a method parameter. sinatra-bundles compresses Javascript files, and as part of that, shrinks variable names. Normally this isn’t a problem, but in this case of eval, it became a problem, since it was trying to reference a local variable that no longer existed (because it got shrunk to s...
Read the full article
My Watch List, Into 2010
Lots of interesting things are afoot, and I try to keep track of them. Here’s what I’m watching. Rails 3 Lots of new changes are coming with Rails 3, and it’s pretty exciting. I wrote about some of the cool ones here. Rails is shaping up to be faster, more modular, and generally better and easier to work with. With all the smart people working on it, you don’t have to look very hard to realize this is going to be a big release, and is only goi...
Read the full article
Rails 3 release notes: What does it mean to you?
The Rails 3 Beta got dropped a few days ago, and the release notes for Rails were put out a bit before that. The list of changes is long; this is a big release. There’s a lot to sift through, a lot to change to upgrade your existing application, and a lot to learn whether you are upgrading or starting a new app. The big question is: WTF does all this mean to me? Don’t worry, I’m going to tell you. If you want to read the full release notes, go...
Read the full article