Archive for the ‘Development’ Category

Friday, August 17th, 2007

Working with our friends at Mogollon we just wrapped up Hadar Metal Design. Mogollon provided the clean industrial design and we did the rest in [valid] HTML 4.01 Strict and CSS.

We made use of JavaScript to perform in-page scrolling, where Flash might have otherwise been used. This keeps the content accessible to all users, and even better, to search engines, err I mean Google. We also tried to keep the markup as semantic as possible to give the site the best chance of being properly indexed with context. It’s probably not as pure as it could have been, we ended up using tables for the scrolling portions so we didn’t have to rely on endless browser hacks. Actually the CSS is relatively hack free.

BBEdit: Escape and Encase a String in Quotes (Updated)

Monday, January 9th, 2006

2007-01-28: I’ve updated the script to correct for a stupid mistake on my part. Now single quotes won’t be unnecessarily escaped.

Here at the Firefall Pro labs we use BBEdit for most of what we do, which is programming of some sort. While working on a PHP script it occurred to me that I spend a small portion of my time encasing strings in quotes and escaping quotes within. Normally this is insignificant, but this time quickly adds up when encapsulating bits of html markup.

The typical recourse is to run a find and replace on selected text and have the quotes replaced with a backslash and a quote (\”). However this only accounts for one type of quotes. To get both you either need to run it again, or make a GREP pattern. Often either solution ends up taking almost the same amount of time that it would to do it by hand, albeit with a little more accuracy, but not at a huge savings in time.

I had hoped that BBEdit would magically have some sort of built in function to do this. They have a few text transformation tools, why not this? Certainly everyone who programs in BBEdit would use it. I didn’t find it, so I e-mailed it in as a feature request. They said maybe it would find it’s way in one day, but till then I should just write my own.

So I did. This file should be placed in BBEdit’s Unix Filters folder and the “.txt” ending should be changed to “.php”. It should run in most BBEdit 8 / 10.4 environments. Naturally use it at your own risk. Despite how simplistic it is, if you find it useful, let me know.