Making Firefox's Web Console readable

Are you blind (like me), but you still want to use Firefox’s new Web Console? Yeah, maybe you’ve noticed that the Web Console has abnormally small fonts with no obvious way to adjust them.

I’ve created a new user style that makes Firefox use your configured monospace font (I use Inconsolata), and also lets you configure font size.

Get it at Userstyles


Changing Drupal 7's built-in jQuery UI theme

jQuery UI, a Javascript widget framework built upon jQuery, comes built-in Drupal 7 core. One of jQuery UI’s nicer features is that you can switch themes by changing out a CSS file.

There are some nice jQuery UI themes out there (unfortunately, not enough!), like Tait Brown’s port of Aristo to jQuery UI (see demo).

But since jQuery UI is in Drupal core, which internally keeps track of CSS files, how do you switch the jQuery UI theme in use?

The Seven theme, including with Drupal core, provides inspiration on the “one true Drupal way” of doing this, by providing hook_css_alter(). Place into your theme’s template.php:

function MYTHEME_css_alter(&$css) {
  if (isset($css['misc/ui/jquery.ui.theme.css'])) {
    $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'MYTHEME') . '/jquery.ui.theme.css';

Replace “MYTHEME” with the name of your theme, and adjust the path to your jQuery UI theme’s CSS file accordingly (the above assumes you place jquery.ui.theme.css in the root folder of your theme).

With this magic in hand, I now have the Aristo jQuery UI theme running on this blog. Looks quite a bit better!

This post was inspired by an answer I posted on StackExchange.


BrowserID session API support for Drupal

Late last week, Mozilla’s Identity team made available a Firefox extension for BrowserID, a new browser-oriented single-sign on mechanism. Click a button in your address bar and automagically login into a website.

Along with it they made available a browser session API—that is, the browser can now keep track and show whether you’re logged in, logged out, etc, also displayed in your address bar.

Drupal had a BrowserID module less than 24 hours after BrowserID’s initial announcement (thanks Isaac Sukin!). Likewise, in the weekend after the session API announcement I helped out and wrote a patch adding support for the new API.

If you’re familiar with Drupal development, install the Drupal module, apply the patch, install the Firefox add-on, and get browser-integrated, one-click login to your Drupal-powered website.

The patched module is running live on this site right now, so please play with it ( does get boring).

At the moment, Drupal’s BrowserID module does not create an account on my blog, so you must do that first, separately. Create an account here, or if you’ve an OpenID, logon with your OpenID directly to also create an account (funny how complicated this has gotten already). Make sure to set and use the same e-mail address as the one you use for your BrowserID. After creating an account, logout, and then log back in using your BrowserID. If you’ve problems/find a bug, please leave comments on the Drupal bug or this blog post—thanks!

[UPDATE: 16 Aug 2010]: Drupal’s BrowserID module now includes my patch; you don’t need to download and apply the patch separately.

I'm Flattr'ed!

2011 Flattr widget

I conducted an experiment back when I wrote my HP N36L review: I added affiliate links to both Amazon and Newegg, hopefully to get some revenue without polluting my site with advertisements.

It was successful; I earned enough to pay for a few cups of espresso, at least.

Many authors have PayPal-powered “tip jars” or links to their Amazon wishlist. I’ve now setup the same, but I think it’s unrealistic visitors spend the requisite time or money to use them.

Enter Flattr, a new “social micropayments” platform, a tip jar evolved to work on Web scale. Flattr is a quick and easy way to give back to content creators—including myself. Rather than trying to explain it, watch Flattr’s introductory video. I love the cake analogy.

If you want to get an item from my Amazon wish list, please do! But what if you wanted to contribute less? And why would anyone else want to use Flattr over PayPal?

Well, one, it’s simpler. Users need only click a single button (the Flattr widget) to Flattr me. Also, users don’t need to worry about figuring out how much to give me—Flattr’s “cake cutting” algorithm does it for you. Nothing stops you from donating more, of course.

Second, Flattr’s rates are better. Say you’ve decided to add $10/month to your Flattr account, and you’ve Flattr’ed 10 people, including me. Each of those people will be entitled to $1. With Flattr’s 10% commission, I’d get 90¢; with PayPal’s default fee schedule, I’d get 67.1¢ ($1-($1×2.9%+$0.30)). Big difference. Flattr works well when you’re dealing with small amounts (called micropayments), exactly the niche market they’re trying to fill.

Imagine you’re walking down the street and hear a great musician, to whom you’d like to donate some small change. It’s easy to do in the real world. With conventional payment systems oriented around transactions, this model doesn’t translate. With Flattr, however, the model does—it brings a donation system and ethic present within the real world onto the Web.

PayPal has its own little-known micropayments platform with a better fee schedule, but it requires the receiver to go through a manual approval process to receive a special account. It’s only available in a few countries and has been a “beta” product for years, implying PayPal does not care much about it. Why should they? PayPal, making money on high-value transactions, has little incentive to develop micropayments—not until there’s marketshare and mindshare to steal, something Flattr is building.

Third, with free culture luminaries like Peter Sunde of The Pirate Bay fame behind it, Flattr seems less likely to “censor” recipients, holding funds hostage and even confiscating them, something for which PayPal is notorious. While I’m not worried about anyone censoring my overly-politically correct blog, should I be OK with organizations unfairly censoring others? *cough* WikiLeaks *cough*

Flattr is so nascent, it’s unlikely I earn a significant amount of money. And the meager money I do earn I will probably use to Flattr others. But it’s easy to use, low-risk for myself and visitors, and most importantly I believe in its ethos—so why not?

If you like this post or my blog, please flattr it!


Subscribe to Samat Says RSS