You are browsing the "Programming" archives.

iPhone NDA Dropped

After hearing the cries of thousands of upset iPhone app developers, Apple has lifted the non-disclosure agreement covering (released) iPhone software. Developers can now freely talk about the inner workings of their applications, write books, publish blog entries, etc. Communicating developers means solutions to common problems get solved and shared, resulting in better software, making the iPhone and iPod Touch platform better as a whole.

For some time I’ve been worried that the NDA was going to remain in place indefinitely, silencing those who Apple needs the most, but it appears Apple has finally taken a positive action to help their App Store environment grow further. If you thought there was some cool stuff on the App Store now, just give it time…

Widerbug 1.2.1 for Firefox 3

For those eagerly anticipating Widerbug: Widescreen Firebug for Firefox 3, the wait is over. Firebug 1.2.1 was just recently released, and I’ve merged the Widerbug modifications into the latest version and tested them under Windows XP and Mac OS X on Firefox 3.0.1.

Head on over to the Widerbug page to grab the latest version and get coding, widescreen style! (Please leave comments and note any bugs on that page, just to keep things centralized.)

fmTuner: A Last.fm Plugin for WordPress

fmTuner BannerThe result of the “Tunes” sidebar element on the Command-Tab homepage, fmTuner is a small WordPress plugin for retrieving song details from your Last.fm profile and publishing them anywhere in your WordPress theme. It provides options for choosing among your Recent, Loved, or Top tracks, as well as tools to adjust the update frequency and appearance:

Settings - fmTuner: A Last.fm Plugin for WordPress

Of particular note is the customizable Display Format option. Using simple tags like [::artist::] and [::image::] intermixed with regular HTML, you can tweak your Last.fm tracks exactly how you like, or however your WordPress theme requires. You have full control!

Download fmTuner Now

Requirements

  • WordPress 2.5 or later.
  • PHP 5 or later (fmTuner uses PHP 5’s SimpleXML for decoding Last.fm data).
  • Basic knowledge of PHP, HTML, and WordPress.

Installation

  • Upload “fmtuner.php” to a directory inside “/wp-content/plugins/” directory. For example: “/wp-content/plugins/fmtuner/fmtuner.php”
  • Ensure “/wp-content/plugins/fmtuner/” is writable by your webserver (chmod 755 fmtuner).
  • Activate the plugin through the “Plugins” menu in WordPress.
  • Set up options in the “Settings” menu in WordPress.
  • Place “if(function_exists(‘fmtuner’)) { fmtuner(); }” in your templates, between PHP tags.

Release History

  • fmTuner 1.1
    Released on Feb. 1, 2010
    Added a placeholder image field to the fmTuner Settings page, which will be substituted when tracks have no artwork.
    Tested under WordPress 2.9.1.
  • fmTuner 1.0.8
    Released on Nov. 3, 2009
    Fixed a bug with the [::url::] fmTuner tag that caused Last.fm links to appear incorrectly.
  • fmTuner 1.0.7
    Released on Apr. 23, 2009
    Tracks with foreign character sets now display more accurately.
  • fmTuner 1.0.6
    Released on Mar. 29, 2009
    You can now display more than 10 Recent Tracks, and you should get fewer tracks without artwork.
  • fmTuner 1.0.5
    Released on Mar. 22, 2009
    Track information is now properly escaped to handle $ signs, quotes, and other non-alphanumeric characters.
  • fmTuner 1.0.4
    Released on Dec. 14, 2008
    Made minor tweaks for fmTuner Settings page under WordPress 2.7.
  • fmTuner 1.0.3
    Released on Nov. 15, 2008
    By request, a [::number::] fmTuner tag has been added, which emits a sequential number for each track (starting at 1). This is particularly useful for CSS and JavaScript display purposes.
  • fmTuner 1.0.2
    Released on Oct. 5, 2008
    Added a cURL-based alternative to file_get_contents to hopefully resolve “URL file-access is disabled” issues. If allow_url_fopen is disabled in the php.ini, cURL will be used to fetch the Last.fm feed instead.
  • fmTuner 1.0.1
    Released on Sept. 9, 2008
    Added better failure checking and informational messages, removed development code, and updated instructions.
  • fmTuner 1.0
    Released on Sept. 6, 2008
    Initial release.

Released under the MIT License. Do with fmTuner whatever you wish. Mod it, mash it, hack it. Make it yours.

Form Jig 1.0

In woodworking, metalworking, and other crafts where exact reproduction of a given piece is crucial, a common tool is a “jig.” A jig is effectively a template for creating a copy. For example, when a door key is duplicated, the cutting machine uses the existing key as a jig, tracing the hills and valleys on its edge to produce an identical version.

Along the same line, when developing a web application or just a simple page, HTML forms require that data be typed in and submitted. This process will repeat as the server-side code is refined, and typing the same data over and over gets old as soon as the second iteration. “Don’t Repeat Yourself”, or “DRY”, is a common philosophy for writing better code, and should extend to testing your forms, as well.

Save your typing for code.

Form Jig is a small Firefox extension for replicating HTML form data and server-side code. To use it, fill out a form on a page, click the red Capture button in your Firefox status bar, then submit the form. Upon returning for further testing, click the green Replay triangle to populate the form just as you left it. Form data is kept around until the current Firefox window is closed, and can be used between tabs.

Install Now

Suggestions are welcomed, and bug reports will be attended to.

6/8/08 Update v1.0.1
Fixed a bug related to checkboxes and radio buttons. The updated plugin should appear on addons.mozilla.org shortly (linked via the above button), but still hasn’t passed Mozilla’s “nomination” for public consumption.

jQueryize Bookmarklet

While developing web applications at my day job, I've come to rely quite heavily on the jQuery JavaScript library. In fact, it's the client-side backbone upon which our company software is built. It comes as no surprise, then, that I sometimes find myself poking around in others' web application code with Firebug (or Widerbug) and wishing I had jQuery at my immediate disposal to perform manipulations with its succinct syntax and practical API.

A day ago, I stumbled upon the answer I was looking for on the Learning jQuery blog: a browser-ready jQuery-loading bookmarklet. For the uninitiated, a bookmarklet is a standard bookmark placed in your Bookmarks Bar, except it runs some JavaScript code instead of pointing your browser at a web destination. In this case, the bookmarklet manually fetches and inserts jQuery into the current page. I've modified the following version slightly to flash "jQuery Loaded" on the page when the load is complete, using the just-loaded jQuery, naturally.

To install the tool, just drag the following link to your Bookmarks Bar, and click it to temporarily install jQuery on whatever page you're visiting: jQueryize