Great collection of Firefox extensions to set up the ultimate Firefox development profile.
At the request of a reader, a blast from the past - a 2003 SEO article that’s way dated, but still has some good points. Help the Googlebot understand your web site
Always will be a sucker for free, good-looking icons.
The first indicator that a design trend is on the way out is when there’s a Javascript toolkit for it. Here’s image reflections.js. (via pb)
Firebug’s creator, Joe Hewitt, demonstrates how he uses Firebug.
Note to self: get better at debugging JavaScript with Firefox.
Ah-ha! So THAT’s the difference between .bash_profile and .bashrc.
Paul’s rumination about launching a website rings so true.
Release: Better Gmail Firefox extension
April 16th, 2007 | Filed under Browsers, Greasemonkey, Extensions, ReleaseBeen awhile since I’ve spent the entire weekend happily coding in a haze, but that’s what happened yesterday and Saturday. The result is the Better Gmail Firefox extension, which packages up my favorite Gmail Greasemonkey scripts into one, standalone extension, with the help of the awesome Greasemonkey Compiler. Check it out.
Release: About This Site Firefox add-on, v. 1.2
January 30th, 2007 | Filed under Open source, Extensions, Release, XULI got all fancy-pants with XUL and Firefox preferences in the latest release of About This Site, a Firefox add-on that hooks you up with all sorts of meta-services when you’re researching a web site (like Alexa graphs, del.icio.us bookmarks, a WhoIs query, etc.)
The new release is only a minor point upgrade but feature-wise it’s major: now you can configure whatever meta-lookups your heart desires in the menu all by yourself. (This will also head off all that email I get from folks requesting that I add their new webapp to the menu.)
Current About This Site users can upgrade just using the auto-update feature; go to your Add-ons in Firefox, right click on About This Site and hit “Find Update.”
What’s more, the fine folks at Lifehacker are funding some of my whimsical open source development efforts, so the extension and some more little utilities I’ve got in the works will be hosted there, under the new Lifehacker Code tag.
A girl cannot subsist on blogging alone. Meep.
PHP foreach loops pass arrays by value
December 17th, 2006 | Filed under PHP, Code snippetsI nearly lost my mind debugging a problem with some PHP I’d written awhile back that wasn’t working as I’d expected on one server (but fine on my own.)
After many hours of cursing myself for not having a better debugging system, I discovered it was a PHP 4 versus PHP 5 code incompatibility. Turns out that PHP passes arrays into foreach loops by value, which means that any changes you make to that array inside the foreach don’t appear after the foreach, because it’s acting on a copy of the arrray instead of the original data.
So code like this:
Doesn’t print “nothingnothing”, which is what I’d expect; it prints “rainbowspuppies.” In PHP4, apparently, there’s no way to get around this. In PHP5, you can pass the array into the foreach by reference using this notation: foreach ($gina->interests as & $interest)
For now, I to make my code both PHP4 and PHP5 compatible, I went with a:
while ($i=0; $i < sizeof($gina->interests); $i++)
Which just isn’t as readable as the foreach. Here’s the PHP doc on foreach (which clearly states the PHP 5 caveat.)
Here’s a handy tip on how to track broken links or missing pages on your site with Google Analytics. Speaking of, here’s how we use Analytics at Lifehacker to figure out which posts are our top performers.
Graphing Amazon sales rank, or automated author navel-gazing
December 2nd, 2006 | Filed under PHP, APILike most authors tasked with promoting their new book, checking Lifehacker the book’s Amazon sales rank has become part of my daily routine. But your book’s sales rank is one of those things - if you obsess about it too much, you’ll lose your mind. “It’s total B.S.,” a writer friend told me. “My agent told me it’s a miniscule representation of your book’s sales overall.” That’s probably less true for tech books than fiction, but either way, I wanted a way to capture my sales rank over time without constantly checking myself like an anxious freak. A number alone after awhile is pretty meaningless, and it literally changes by the hour.
So, inspired by PB’s graphing post and a curiosity about Amazon’s API, I set out to write a little something that would help me visualize what’s happening with the book’s sales over time. I didn’t get into the hardcore tools Paul did - just the names RRDTool or SNMP scare me - so I instead opted for the very no-frills, Flash-based PHP/SWF graphs. After registering for a free key, I was delighted to find that the Amazon API is dead simple. In less than 30 minutes of a little PHP/MySQL hacking, I had a sales rank capture-and-graph set of PHP scripts. It’s turned out to be a really nice way to keep an eye out without reloading the book’s Amazon page 4 times a day like a total egotistical loser.
Here’s the finished Lifehacker book Amazon sales rank charter. Screengrab below:
Firefox 2.0 extension development
November 1st, 2006 | Filed under Firefox, Extensions, ReleaseI wrote my first Firefox extension for version 0.9 in September of 2004. The development process was a huge pain in the ass, but I pressed on, powered by sheer delight that I could develop an interface within the Firefox chrome.
Two years and one point one version later, I’ve revisited Mozilla’s extension development docs, processes and community. What an improvement! You can actually make changes to your extension and see them without repackaging, uninstalling, restarting, reinstalling and restarting again! There’s a fabulous Extension Maker wizard that produces an extension skeleton starter file set, and batch scripts to do the packaging for you. It’s all very exciting. Here are some tools and reference links I used to update my extensions:
- The aformentioned Extension Wizard
- Setting up the extension development environment [Mozillazine]
- Getting started with extension development [Mozillazine]
When I was done updating all my extensions, I got all uppity and submitted one to the Mozilla Add-ons directory. To my surprise and dismay/happiness, an editor tested it and rejected the submission because the extension threw a Javascript error! (An error that didn’t keep it from working, mind you, just cluttered up the Error Console.) I was pretty impressed with their vigilance (and sheepish about my shitty code), so I fixed it and re-submitted. It just got accepted.
Here’s a final list of my completed (and very simple) extensions, now compatible with Firefox 2.0:
I’ve got a few more extension ideas in the works, especially for web writers.
Notes on Mozilla Update: The great thing about hosting your extension there is that they take care of the auto-update on new versions, count your downloads for you, have per-extension comments enabled and are generally considered a trusted source for extensions (because they, you know, actually test them, as I found out). The bad part is that to host on Mozilla Update, you have to remove your custom auto-update URL from the install.rdf file. So, if you want to host your own extension (like say, to run ads on the page or include them in your custom portfolio) in addition to making it available on Mozilla Update, you have to build TWO separate versions - one, without an updateUrl set for Mozilla Update and one WITH an updateUrl for your own hosted version. That part kinda sucks.
Comment cleanup
November 1st, 2006 | Filed under Announcements, Code snippets, WordPress, SQLUPDATE wp_posts SET comment_status='closed';
DELETE FROM wp_comments;
Sorry folks, comments here on Spun are now disabled - the spam got the better of me. I know, I know, there are plugins to help manage it, but I simply don’t have the time. Email me your thoughts on posts to ginatrapani at gmail.
Rasmus Lerdorf’s PHP5 talk at Yahoo! Open Hack Day covered how to squeeze the most performance out of your PHP pages. (This mailing list message from earlier this year covers how to use valgrind and KCacheGrind as well.) Very enlightening.
Microsoft invites hackers to attack Vista: “A short time later, Joanna Rutkowska obliged…Before a crowd of fellow researchers and hackers, she bypassed security measures and implanted a potentially undetectable piece of malicious code called ‘Blue Pill.’ The presentation, titled ‘Subverting Vista Kernel for Fun and Profit,’ was rewarded with a hearty round of applause.”
Programmer, Meet Designer: because “rarely is a person good at both programming and designing.”
While I think the result still looks very much like a blog and not as much as a magazine as I’d like (why must CMSes influence their output so much?!), this tutorial on How to use WordPress to run a magazine may come in handy some day.