Posts in "Development"

Auto-Sizing Textareas with jQuery

Every website that I build ends up being better than the last. Something becomes more efficient, or some new little detail becomes standard. One such detail has been automatically-sizing textareas, similar to Facebook’s. It’s a simple idea: the user types more text, the text area gets bigger. It requires no extra UI, it makes perfect sense as it happens, and it degrades without issue. The jQuery plugin I keep coming back to is James Padolsey’s autoResize.

I’ve also made a habit of having textareas size automatically when the page loads, in the even that there’s already text in the field to be edited:

$('textarea.autosize').autoResize().trigger('change');

WordPress Database Flakiness

We’ve all been there with a WordPress install: “Can’t Establish a Database Connection”.

I made sure that my connection info was correct, and unlike every other PHP app install, I continued to get the error.

Full Article »

Good Introduction to HTML5

A List Apart’s first publication, “HTML5 for Web Designers,” is both an easy one-sitting read and a warm introduction to HTML5. I dare you to try reading it and not geek out, even just a little bit, over what’s just around the corner.

Firefox 3.6.3 Cache Issue

I’ve been customizing Mark Huot’s Livesearch extension for ExpressionEngine, which combines the livesearch jQuery plugin with an ExpressionEngine plugin for returning formatted query results.

The livesearch JavaScript has a built-in caching mechanism that didn’t seem to be clearing in Firefox. In Safari, IE, and others, valid search results (weblog entries) were being returned as one would expect. In Firefox, old/deleted entries were being returned as search results. In Firefox 3.6.3 (both for myself and my client), the browser cache couldn’t be completely cleared.

The only way to fix the problem was to view the JavaScript file (jquery.livesearch.js) directly in the browser, then hold shift and click refresh.

I also updated the headers to prevent excessive caching in the first place.

Rolling Your Own SVN Server

It finally dawned on me that using one subversion repository for all my projects was silly. If each project has its own repository, there are some benefits:

  1. My revision comments make lots of sense and follow a logical path.
  2. My revision numbers are more meaningful, and pertain to each project directly.
  3. I can easily share access to one project with someone else if I need to, without exposing all of my work or potentially sensitive information.
  4. I can join the rest of the world that’s using subversion properly.

So why wasn’t I doing this sooner? I learned to use subversion this way, and it actually helped when I decided to use Beanstalk. Beanstalk is awesome, provides lots of hooks and cool features, and is just lovely. The obstacle in my repository-for-every-project quest was Beanstalk’s limit on repositories. With the $15/month account, I could only have 10 repositories. I could pay more for additional repositories, but I’m cheap and ambitious and there seemed like there had to be a better way. And there was. Here’s how I set up stylish subversion hosting with unlimited repositories for $19.95 a month.

Full Article »

Debugging PHP with Webgrind

I just caught a post over at BKWLD about using Webgrind with MAMP to debug PHP. I had to upgrade MAMP to 1.8.4 to take advantage of the newer Zend Optimizer, but once I did things went pretty smoothly. If you’re not already using Webgrind (a front-end for Xdebug), you should be.

Page 1 of 2
 1 2 >