Doing more with data
Firefox users: Did you know that you have private database that contains all your browsing information?
Well, you do. And here's the thing:
- Only you have access to it
- It's under-utilized
- You probably didn't even know it existed
Browsing could be better. There's no question about that. We have set conventions and preconceived notions about how browsing should be. That is, until the next big thing comes along and rocks our world.
It feels like using data to improve browsing is a no-brainer, and data-driven browsing is already the next big thing. You see this in search suggests, amazon suggested items, the iTunes store, and other sites. And that's just all site-specific. Imagine if we used data the right way and made things just click?
On a limited scale, it's all more than possible today. You have complete control over your own browsing history:
- Sites visited
- Bookmarks
- Awesome bar history
- Media viewed
- Favorite sites
- Search keywords
- Trending of all the above
Simple fact is that you're not using as much as you could.
The Firefox awesome bar was heralded as a great step in browsing innovation. And it's true, it really was. And that's because a lot of browsing is really repeat browsing. How many times do you go back and view what you just looked at the other day?
But that's the tip of the iceberg. There are a lot of things we can learn about the web and about how we use the web to make it better. And don't think about person -> corporation -> other corporations. For starters, think about what you could do with just your own browsing data, or your family's browsing data:
- Easy access to repeat searches - movies, facebook, maps, you name it
- An automated media catalog of images, videos and news articles you read over time
- A list of phone numbers you have looked up and who they belong to
- A list of all map directions you've ever done
- A list of people you read about over the last week
The awesome bar in Firefox already uses this, and it's great to see some Firefox extensions are already tapping into the possibilities:
- about:me lets you read about your own browsing statistics
- Voyage is a very cool way to not only view the sites you've used but see how you got there over time and whether or not you Tweeted about it!
Those are just two examples of what we can do and where we can go. I'm pretty excited to see what happens next. Maybe you have the next great idea -- go forth!
Tabbing Through Elements in Firefox on Mac
This weekend my laptop decided to die after the latest batch of Apple system updates. Not sure why, but on the first startup after the update, it wanted to randomly shut off (hard power-down) and could not get out of that cycle. Thanks, Apple.
So I did my first successful restore from a Time Machine backup. However, while I was waiting, I used a vanilla install of Firefox. I noticed that I couldn't tab through form elements and it would jump straight from the page to the address bar. WTF?
Here is how you enable this tab behavior that you're used to on Windows:
- Go to System Preferences... in the apple menu
- Open Keyboard & Mouse
- Go to the Keyboard Shortcuts tab
- Check All controls
This will let you tab through individual web elements normally. Screenshot below, in case it helps.

Update: Alex Faaborg noted that you can track Bug 437296 if you'd like to follow overriding OS keyboard settings to maintain a consistent user experience in the browser across platforms.
Update: Chris Ilias pointed out so kindly that this is already in the Mozilla Knoledge base.
Profiling PHP with Xdebug and Webgrind
Using Webgrind and Xdebug, you to tack on ?XDEBUG_PROFILE=true to any URL and view profiling information for that particular URL instantly.
One of the main criticisms of profiling PHP applications has been how difficult it is to manage different kcachegrind or wincachegrind windows -- assuming you're a pro at pointing them to your Xdebug output directory and all that good stuff. I am excited about how easy webgrind makes things because easier profiling will help prevent a lot of stupid performance mistakes (for those of us not using the Zend IDE and its sexy profiler, which is a lot of people).
This is really quite simple to set up, and is best used on a dev box behind a firewall with port 80 closed. People can file surf your web server if you leave webgrind on an open port, don't do it.
So, you've read the last paragraph, right? Ok, good. Let's go.
Use pecl to install the json and xdebug packages
pecl install json pecl install xdebug
You'll run into a possible missing phpize issue, in which case you'd need the php-devel package for building PHP extensions.
Configure Xdebug
A simple configuration to get you what you need is below. Read the Xdebug docs if you want to get crazy.
; Enable xdebug extension module zend_extension=xdebug.so ; Turns it off by default xdebug.profiler_enable=0 ; Turns xdebug on when ?XDEBUG_PROFILE=true is in GET or POST xdebug.profiler_enable_trigger=1 ; Your output directory - you'll eventually point webgrind at this xdebug.profiler_output_dir=/tmp/xdebug
If you're not on PHP 5.2.x, you'll also need the json extension.
; Enable json extension module extension=json.so
Restart Apache.
Download and install webgrind
Webgrind is easy to setup, download it and follow the instructions. The main thing you'll want to do is make sure your Xdebug directories are the same. In this case, it's /tmp/xdebug
Load any PHP app with ?XDEBUG_PROFILE=true
Now you'll want to hit your web server with the appropriate GET argument set up. So, you could hit localhost/helloworld?XDEBUG_PROFILE=true and it'd create a new cachgrind.out for that request.
Open up a tab with webgrind in it and enjoy
Webgrind will do a find on your Xdebug output directory and have a list of all your cachegrind.out files up on the top right. Now all you have to do is choose one. Webgrind's use of jQuery and AJAX makes the app a great example of what you can do with JavaScript and a little motivation. Check it out.
Update: You should use "zend_extension" in your .ini file, not extension. I had a typo above, but it's corrected.
