<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Labs</title>
	<atom:link href="http://labs.iamkoa.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.iamkoa.net</link>
	<description>I break it. I fix it. You learn.</description>
	<lastBuildDate>Fri, 09 Jul 2010 02:26:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Audio Hijack Equivalent for Ubuntu [Linux, ffmpeg]</title>
		<link>http://labs.iamkoa.net/2010/07/08/audio-hijack-equivalent-for-ubuntu-linux-ffmpeg/</link>
		<comments>http://labs.iamkoa.net/2010/07/08/audio-hijack-equivalent-for-ubuntu-linux-ffmpeg/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 02:26:36 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=343</guid>
		<description><![CDATA[If you own a Mac and frequently rip audio from streaming content on the internet, then you&#8217;ve probably already heard of Audio Hijack. The majority of times I used Audio Hijack was for ripping audio from YouTube videos such as this one. I&#8217;ll show you how to download YouTube videos in FLV format, then rip [...]]]></description>
			<content:encoded><![CDATA[<p>If you own a Mac and frequently rip audio from streaming content on the internet, then you&#8217;ve probably already heard of <a href="http://www.rogueamoeba.com/audiohijackpro/">Audio Hijack</a>. The majority of times I used Audio Hijack was for ripping audio from YouTube videos <a href="http://www.youtube.com/watch?v=MX0D4oZwCsA&#038;playnext_from=TL&#038;videos=1OVHpIwYBgk">such as this one</a>. I&#8217;ll show you how to download YouTube videos in FLV format, then rip the audio from those videos and save them as an MP3 file, all on Ubuntu.</p>
<p><span id="more-343"></span></p>
<h2>FlashGot Addon for Firefox</h2>
<p>You&#8217;ll want to install a Firefox extension called <a href="https://addons.mozilla.org/en-US/firefox/addon/220/">FlashGot</a> in order to download the YouTube movie onto your computer.</p>
<p>Once you&#8217;ve installed FlashGot, go to YouTube and surf to the video that you want to download. In the lower-right corner of your browser, click the FlashGot icon to select where you&#8217;d like to download the video (.flv) file. It should automatically begin downloading.</p>
<h2>Apt-Get the Stuff You Need</h2>
<p>Before you can convert your Flash video (.flv) to an MP3, you need to install a few tools. Open terminal and type the following:</p>
<pre class="brush:xml;gutter:false;toolbar:false">
sudo apt-get install lame ffmpeg libavcodec-unstripped-52
</pre>
<p>Once the installation completes, you&#8217;re ready to convert your .flv file to an mp3 file.</p>
<h2>From .flv to .mp3 in one line</h2>
<p>Open terminal, <code>cd</code> to the directory where you&#8217;ve saved your Flash video, and run the following, replacing <code>SOURCE_NAME</code> and <code>DESTINATION_NAME</code> accordingly:</p>
<pre class="brush:xml;gutter:false;toolbar:false">
ffmpeg -i SOURCE_NAME.flv -acodec libmp3lame -ar 44100 -ab 160k -ac 2 DESTINATION_NAME.mp3
</pre>
<p>You should have yourself a nice, compressed .mp3 file.</p>
<h2>Convert to other formats: mpeg, avi, wav, etc</h2>
<p>With the power of <code>ffmpeg</code>, you can convert audio and video files to almost anything. <a href="http://www.ffmpeg.org/documentation.html">Learn more about ffmpeg</a> if you want to tweak your output.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/07/08/audio-hijack-equivalent-for-ubuntu-linux-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Thing&#8217;s First: Validate</title>
		<link>http://labs.iamkoa.net/2010/07/02/first-things-first-validate/</link>
		<comments>http://labs.iamkoa.net/2010/07/02/first-things-first-validate/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 22:44:43 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=338</guid>
		<description><![CDATA[Have a sweet function written that requires valid variables? Make sure you&#8217;re validating those variables at the top of your function. Validating variables before (as apposed to while) they are used is key in making sure that important logic isn&#8217;t executed using crappy data. Here&#8217;s an example of validating first, then executing: /* The good... [...]]]></description>
			<content:encoded><![CDATA[<p>Have a sweet function written that requires valid variables? Make sure you&#8217;re validating those variables at the top of your function. Validating variables <em>before</em> (as apposed to <em>while</em>) they are used is key in making sure that important logic isn&#8217;t executed using crappy data.</p>
<p>Here&#8217;s an example of validating first, then executing:</p>
<pre class="brush:php">
	/* The good... */
	public function insertNewInvoiceItem($item, $quantity)
	{
		if(!$item instanceof Shop_Item) {
			throw new InvalidArgumentException ('Expecting an item to be an instance of Shop_Item.');
		}

		if(!is_numeric($quantity)) {
			throw new InvalidArgumentException('Quantity is not numeric.');
		}

		// We're good to go. Continue with the function...
	}
</pre>
<p>The method above is also much cleaner than <code>if... else... </code> statements and limits the extra (perhaps useless) work required by your code:</p>
<pre class="brush:php">
	/* The bad... */
	public function insertNewInvoiceItem($item, $quantity)
	{
		if($item instanceof Shop_Item) {
			// Do some $item stuff...

			if(is_numeric($quantity)) {
				// Do some $quantity calculations
			} else {
				// Uh oh, $quantity was bad but we've
				// run some Shop_Item logic already.
			}
		}
		else
		{
			// $item is not part of Shop_Item
		}
	}
</pre>
<p>I used a simple example to demonstrate my point but when this technique is used on more complex logic, it&#8217;s benefits are much more obvious.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/07/02/first-things-first-validate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &amp; JS Coding Standards / Organization [OOP]</title>
		<link>http://labs.iamkoa.net/2010/07/01/css-js-coding-standards-organization-oop/</link>
		<comments>http://labs.iamkoa.net/2010/07/01/css-js-coding-standards-organization-oop/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 23:55:43 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=296</guid>
		<description><![CDATA[By no means should this article serve as the bible of CSS &#038; JS coding standards, though it should get the ball rolling for those who are unsure where to start. Over the years, I&#8217;ve had the privilege of working with many talented developers, each of whom have left little bits and pieces of their [...]]]></description>
			<content:encoded><![CDATA[<p>By no means should this article serve as the bible of CSS &#038; JS coding standards, though it should get the ball rolling for those who are unsure where to start. Over the years, I&#8217;ve had the privilege of working with many talented developers, each of whom have left little bits and pieces of their coding style behind. From those pieces I&#8217;ve assembled this article.</p>
<p>Let&#8217;s begin&#8230;</p>
<h2>Alphabetize Your Code</h2>
<p>Alphabetizing your code is an extra organizational step often overlooked. It&#8217;s especially helpful in PHP classes containing getter and setter functions, but it also comes in handy for CSS and JS. Often times similarly named elements will be somewhat related in function, so clustering them together makes them easier to find.</p>
<p>I&#8217;d recommend alphabetizing everything from JS class and function names, to CSS classes and ID&#8217;s. You&#8217;ll notice that every code example in this article is alphabetized to further exemplify the point.</p>
<p><span id="more-296"></span></p>
<hr />
<h2>Comment Everything</h2>
<p>Comments are essential, especially among devs working in groups. The styles seem to vary slightly from person to person, but the theme is the same &#8211; you can never comment too much.</p>
<p>Here is my commenting style for JS / PHP:</p>
<pre class="brush:js">
/******************************************************
 * Cart.class.js
 *
 * A class of JS functions associated with the
 * tasks performed by the shopping cart.
 * @author Koa Metter em@mail.com
 * @copyright Copyright (c) 2010, Company
 ******************************************************/
var Cart = {

    // ...

    /**
     * Add item to cart
     * @param string item_id
     * @param string item_quantity
     * @todo Check for string validity
     */
    addCartItem: function (item_id, item_quantity)
    {
        if (!Utilities.isEmpty($('#cart-items')))
		{
			Cart.AJAX({
				data: 'call=addOfferingToCart&#038;args[0]='+item_id+'&#038;args[1]='+item_quantity,

				// Things we'd like to do upon 'status => success' ajax response
				success: function (msg)
				{
					Cart.displayNewCartItem(msg);

					// Update cart total price
					Cart.displayCartTotal();

					// Also update checkout rebilling terms!
					if (msg.response.rebilling_terms_agreement){
						$('#billing-terms-agreement-label').html(msg.response.rebilling_terms_agreement);
					}

					Cart.proceedBtnCheck();
				}
			});
		}
    }

}
</pre>
<p>When commenting in PHP, <a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html">phpDocumentor</a> can be used to build a comprehensive dev manual for your source code. I use the same documentation style for JS simply because I come from a PHP background.</p>
<p>Though CSS doesn&#8217;t need the phpDocumentor-type of commenting, it should nevertheless remain detailed to explain the elements and their purpose. Clustering elements that are related to the same stylistic area or function of the website helps in organizing without the need of many comment blocks.</p>
<hr />
<h2>Indent CSS</h2>
<p>Indenting your code is an obvious standard with most programing languages, but often times CSS is left out of the loop. Indent a CSS element if it&#8217;s a child of a parent element, like so:</p>
<pre class="brush:css">
#container {
    color:#222;
    width:100%;
    z-index:1;
}

    #container .lg-block {
        height:300px;
    }

    #container .sm-block {
        height:100px;
    }

.etc {
    /* ... */
}
</pre>
<p>The above CSS example shows that the class <code>.lg-block</code> is specifically contained within the ID <code>#container</code>, thus we are indenting it to visually represent the same thing.</p>
<hr />
<h2>OOP-ish Javascript</h2>
<p>This topic deviates slightly from actual &#8220;coding standards&#8221;, but I think it&#8217;s equally important &#8211; how to format your JS into usable, organized classes. This rule takes into account all other coding standards (alphabetization, indentation, commenting, etc) and applies them to JS, adding in OOP-like objects.</p>
<p>Here&#8217;s an example:</p>
<pre class="brush:js">
var Vehicles = {
    /*
     * Give us the word "Bus"
     * @return string
     */
    bus: function ()
    {
        return 'Bus';
    },

    /*
     * Give us the word "Car"
     * @return string
     */
    car: function ()
    {
        return 'Car.';
    },

    /*
     * Give both car() and truck()
     * @return string
     */
    getCarAndTruck: function ()
    {
        return this.car + ' and ' + this.truck;
    },

    /*
     * Give us the word "Truck"
     * @return string
     */
    truck: function()
    {
        return 'Truck.';
    }
}

// Let's call the function getCarAndTruck like so:
Vehicles.getCarAndTruck();
</pre>
<p>Shuffling your JS into objects helps associate functions with tasks / groups and thus creates a more organized codebase.</p>
<hr />
<p>Hopefully this helps. If you have a different method of commenting and/or organizing your CSS or JS code, let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/07/01/css-js-coding-standards-organization-oop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Three Bitchin&#8217; PHP Classes &#8211; Cache, Last.fm API, Time</title>
		<link>http://labs.iamkoa.net/2010/04/21/three-bitchin-php-classes-cache-last-fm-api-time/</link>
		<comments>http://labs.iamkoa.net/2010/04/21/three-bitchin-php-classes-cache-last-fm-api-time/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 07:11:23 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=77</guid>
		<description><![CDATA[There&#8217;s nothing like the feeling that comes with typing a few lines in a PHP application and letting some included classes take care of the dirty work; you know, the filthy stuff like caching, calling the Last.fm API, purifying timestamps, and handling file uploads. (Dirty, right?) All of the following PHP classes are &#8220;works in [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s nothing like the feeling that comes with typing a few lines in a PHP application and letting some included classes take care of the dirty work; you know, the filthy stuff like <strong>caching</strong>, <strong>calling the Last.fm API</strong>, <strong>purifying timestamps</strong>, and <strong>handling file uploads</strong>. (Dirty, right?)</p>
<p>All of the following PHP classes are &#8220;works in progress&#8221;, but hopefully each is mature enough to find its way into your code. Continue reading to view, download, and use each class.</p>
<p><span id="more-77"></span></p>
<hr />
<h2>Cache &#8211; Output &#038; Object Caching</h2>
<p>Though this class is old (three years), it does the trick, and quickly. <a href="http://www.phpclasses.org/browse/package/3807.html" target="_blank">Dragon Bosnjak</a> wrote this gem, allowing for easy caching of webpage content into a directory (and filename) of your choosing.</p>
<h3>Using Cache Class</h3>
<p>Caching your web content is a breeze! Create a new Cache class by specifying a directory to store the cache file, and surround your webpage content in a <code>while</code> loop, like so:</p>
<pre class="brush:php">
$cache = new Cache("../cache/");

while ($cache->save("filename.cache", 30)) {
	// "30" is the number of seconds the content should remain cached.
	// Your cached content goes here...
 }
</pre>
<h3>Download Cache</h3>
<p>You can download and use this golden-nugget of love by visiting <a href="http://www.phpclasses.org/browse/package/3807.html" target="_blank">PHP Classes</a> &#8211; perhaps the most poorly styled/organized website on the internet, but that&#8217;s another post entirely.</p>
<hr />
<h2>Last.fm API</h2>
<p>If you have yet to discover the hotness of using <a href="http://us2.php.net/oop5.magic" target="_blank">&#8220;Magic Methods&#8221; in PHP</a>, I suggest you read up on how to serve up a magic teapot of greatness using PHP5. These Magic Methods are exactly what I used to create this simple Last.fm API class. The result is the ability to quickly make <em>almost</em> any API call without having to continuously fiddle with API key variables, etc.</p>
<h3>Using Last.fm API Class</h3>
<p>After including the LastFm class file, you need to create a new instance of the <code>LastFm()</code> class.</p>
<pre class="brush:php">
// include class file
include_once('../inc/class.lastfm.php');

// initate LastFm class
$lastfm = new LastFm();
$lastfm->key = "1234567890"; // your LastFm API key
</pre>
<p>Then you can call your LastFm API action using the following conversion:</p>
<p>Let&#8217;s say we want to call <a href="http://www.last.fm/api/show?service=299" target="_blank">User.getTopAlbums</a> with the <strong>user</strong> argument set to <code>bob</code> and the <strong>period</strong> argument set to <code>3month</code>:</p>
<pre class="brush:php">
$lastfm->user_getTopAlbums("user=iamkoa","period=3month");
</pre>
<p>The above PHP code will generate the following API call:</p>
<pre class="brush:html">

http://ws.audioscrobbler.com/2.0/?method=user.getTopAlbums&#038;user=bob&#038;period=3month&#038;api_key=1234567890
</pre>
<h3>Let The Class Parse Things For You&#8230;</h3>
<p>The API call will return, for example, the following XML to Array:</p>
<pre class="brush:php">
Array
(
    [lfm] => Array
        (
            [attr] => Array
                (
                    [status] => ok
                )

            [recenttracks] => Array
                (
                    [attr] => Array
                        (
                            [user] => iamkoa
                            [page] => 1
                            [perPage] => 8
                            [totalPages] => 2777
                        )

                    [track] => Array
                        (
                            [0] => Array
                                (
                                    [artist] => Array
                                        (
                                            [value] => Black Eyed Peas
                                            [attr] => Array
                                                (
                                                    [mbid] => d5be5333-4171-427e-8e12-732087c6b78e
                                                )

                                        )
// etc...
</pre>
<p>To make any Last.fm API call, simply replace the <code>.</code> symbol with an <code>_</code> symbol and include any arguments with a <code>"var=bar"</code> pattern. For example, here&#8217;s how to make a couple calls:</p>
<pre class="brush:php">
// call user.getWeeklyTrackChart
$lastfm->user_getWeeklyTrackChart("user=iamkoa");

// call group.getMembers
$lastfm->group_getMembers("group=groupName");

// etc...
</pre>
<h3>Download Last.fm</h3>
<p><a href="http://labs.iamkoa.net/wp-content/uploads/2010/04/php-class-lastfm-04222010.zip">Download and use the Last.fm PHP class</a>. Please post any enhancements to the class here for others to use.</p>
<hr />
<h2>Time</h2>
<p>Time is a bitch. It&#8217;s always against us. In the case of parsing a date string into a human-friendly string, it&#8217;s even more apparent that time sucks. Hopefully this Time class, though not entirely finished, will help with parsing dates.</p>
<h3>Use it</h3>
<p>It&#8217;s really, really simple to use:</p>
<pre class="brush:php">
$time = new Time();
echo $time->timeAgoInWords($date_string);
</pre>
<p>Depending upon when <code>$date_string</code> is relative to the current time, the above code might print one of the following:</p>
<p><code>"26 July, 2:45 PM", "Yesterday morning", "Today", "Last night", or "28 minutes ago", etc...</code></p>
<p>Editing the class is pretty simple, so I&#8217;ll let all you hackers dig into it for details.</p>
<h3>Download Time</h3>
<p><a href="http://labs.iamkoa.net/wp-content/uploads/2010/04/php-class-time-04222010.zip">Download and use the Time PHP class</a>. Please post any enhancements to the class here for others to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/04/21/three-bitchin-php-classes-cache-last-fm-api-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flicka Video!</title>
		<link>http://labs.iamkoa.net/2010/04/21/flicka-video/</link>
		<comments>http://labs.iamkoa.net/2010/04/21/flicka-video/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:42:06 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=250</guid>
		<description><![CDATA[Proof that Flicka actually exists and isn&#8217;t just Photoshop mockups&#8230; Flicka: Beta Teaser from Flicka on Vimeo. Official Flicka website gives more information&#8230;]]></description>
			<content:encoded><![CDATA[<p>Proof that Flicka actually exists and isn&#8217;t just Photoshop mockups&#8230;</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=11100618&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=11100618&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/11100618">Flicka: Beta Teaser</a> from <a href="http://vimeo.com/user3374657">Flicka</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><a href="http://www.flicka.mobi">Official Flicka website</a> gives more information&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/04/21/flicka-video/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Photos, Not Just On Flickr Anymore&#8230;</title>
		<link>http://labs.iamkoa.net/2010/03/02/photos-not-just-on-flickr-anymore/</link>
		<comments>http://labs.iamkoa.net/2010/03/02/photos-not-just-on-flickr-anymore/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 03:29:41 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Self-Promotion]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=223</guid>
		<description><![CDATA[I&#8217;ve finished a simple, photography-showcasing website for myself &#8211; which comes with a super-unoriginal URL: photos.iamkoa.net If you&#8217;re interested in photography or have a showcase website of your own, leave a comment. Props to Flickr, Cufon, jQuery, Masonry, and Lightbox for making the website dazzle.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/iamkoa/4402757962/" title="photos.iamkoa.net by iamkoa"><img src="http://farm3.static.flickr.com/2718/4402757962_10665e44b2_m.jpg" width="240" height="196" alt="photos.iamkoa.net" class="alignleft" /></a></p>
<p>I&#8217;ve finished a simple, photography-showcasing website for myself &#8211; which comes with a super-unoriginal URL:<br />
<a href="http://photos.iamkoa.net/">photos.iamkoa.net</a></p>
<p>If you&#8217;re interested in photography or have a showcase website of your own, leave a comment.</p>
<p>Props to <a href="http://flickr.com/iamkoa">Flickr</a>, <a href="http://cufon.shoqolate.com/">Cufon</a>, <a href="http://jquery.com">jQuery</a>, <a href="http://desandro.com/resources/jquery-masonry">Masonry</a>, and <a href="http://leandrovieira.com/projects/jquery/lightbox/">Lightbox</a> for making the website dazzle.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/03/02/photos-not-just-on-flickr-anymore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flicka &#8211; Flickr for Android</title>
		<link>http://labs.iamkoa.net/2010/02/11/flicka-flickr-for-android/</link>
		<comments>http://labs.iamkoa.net/2010/02/11/flicka-flickr-for-android/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:52:17 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=202</guid>
		<description><![CDATA[An application for Android is about to win the hearts of Flickr fans and photography enthusiasts alike &#8211; it&#8217;s called Flicka, and it promises to bring the power of Flickr to your Android device. Here&#8217;s a few key features as listed on Flicka&#8217;s blog: Notifications&#160;: Customizable notifications immediately inform you of new Flickr contact uploads, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/services/apps/72157623025084241/"><img src="http://labs.iamkoa.net/wp-content/uploads/2010/02/flicka-mockup-home.png" style="border:none" alt="Flicka - Flickr for Android" title="Flicka - Flickr for Android" width="245" height="435" class="alignright size-full wp-image-207" /></a></p>
<p>An application for Android is about to win the hearts of <a href="http://flickr.com" target="_blank">Flickr</a> fans and photography enthusiasts alike &#8211; it&#8217;s called <em><a href="http://flicka.mobi" target="_blank">Flicka</a></em>, and it promises to bring the power of Flickr to your Android device.</p>
<p>Here&#8217;s a few key features as listed on <a href="http://flickamobi.tumblr.com/" target="_blank">Flicka&#8217;s blog</a>:<br />
<small></p>
<ul>
<li>
<b>Notifications</b>&nbsp;: Customizable notifications immediately inform you of new Flickr contact uploads, Flickr mail, Photostream comments, etc. directly in your Android notifications bar.</p>
</li>
<li>
<b>Favorites</b>&nbsp;: Quickly browse, add, and remove your Flickr favorites. Viewing a favorite (or any photo) gives you the option to easily set the photo as your Android wallpaper or contact icon.</p>
</li>
<li>
<b>Search</b>, <b>Groups</b>, <b>Contacts</b>, &amp; <b>Upload</b>&nbsp;: <i>Flicka</i> gives you the ability to preform powerful searches on Flickr &#8211; browse, join, or remove yourself from Flickr groups &#8211; browse, add, and remove Flickr contacts &#8211; and upload content directly from your phone to Flickr.</p>
</li>
</ul>
<p></small></p>
<p>Flicka needs to be on my phone. Now!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2010/02/11/flicka-flickr-for-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Easily Pimp Your Mac OS X Desktop</title>
		<link>http://labs.iamkoa.net/2009/03/17/easily-pimp-your-mac-os-x-desktop/</link>
		<comments>http://labs.iamkoa.net/2009/03/17/easily-pimp-your-mac-os-x-desktop/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 01:25:17 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[beauty]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=83</guid>
		<description><![CDATA[Mac OS X may not be as easy as Ubuntu to customize, but thanks to GeekTool, you can make your desktop background a little more useful than just eye-candy. I&#8217;ll show you how to easily add a calendar, multiple clocks (display both relative and non-relative time), a live system processes chart, and a system up-time [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://labs.iamkoa.net/wp-content/uploads/2009/03/mac-os-x-background.jpg" target="_blank"><img src="http://labs.iamkoa.net/wp-content/uploads/2009/03/mac-os-x-background-300x187.jpg" alt="Mac OS X Using GeekTool" title="Mac OS X Using GeekTool" width="300" height="187" class="alignleft size-medium wp-image-84" /></a></p>
<p>Mac OS X may not be as easy as Ubuntu to customize, but thanks to <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a>, you can make your desktop background a little more useful than just eye-candy. I&#8217;ll show you how to easily add a calendar, multiple clocks (display both relative and non-relative time), a live system processes chart, and a system up-time timer (with load averages) to your desktop. Of course you can easily add more items, but this should be enough to get you started.
</p>
<p>
Sounds completely geeky (and it totally is), but <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> makes you and your desktop look awesome &#8211; it also increases sexual pleasure and makes you last longer in bed.
</p>
<p><span id="more-83"></span></p>
<p><h2>Get Your GeekTool Ready</h2>
<p>Obviously none of this action would be possible without <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a>, so go download yourself a copy and <a href="http://projects.tynsoe.org/en/geektool/doc.php">install it</a>. The install should take you 30 seconds or less. Skim over the <strong>Introduction</strong> to give yourself a quick overview of your new best friend.
</p>
<p><h2>Add The Goods To GeekTool</h2>
<p>Now that you have GeekTool installed, it&#8217;s time to add some magic to your desktop. (You can reference my desktop screenshot above as you add your GeekTool components.)<br />
<a href="http://labs.iamkoa.net/wp-content/uploads/2009/03/ss1.jpg"><img src="http://labs.iamkoa.net/wp-content/uploads/2009/03/ss1-150x150.jpg" alt="GeekTool Screenshot" title="GeekTool Screenshot" width="150" height="150" class="alignleft size-thumbnail wp-image-102" /></a></p>
<p>For each component you add, you can drag and resize the window in which they appear &#8211; you&#8217;ll see what I mean once you begin.</p>
<p>To add a new component, click &#8220;New Entry&#8221; in GeekTool and under the main configuration frame drop-down menu (#3 in the screenshot), choose &#8220;Shell&#8221;, then insert the following code into the &#8220;Command&#8221; textbox. The &#8220;Refresh&#8221; input box can be changed to rerun the Shell command every number of seconds.</p>
<p>Here we go from bottom to top of my desktop screenshot:</p>
<h3>System Uptime Stats</h3>
<p><code>uptime</code><br />
Set refresh to ten.</p>
<h3>System Processes Chart</h3>
<p><code>top -l1 -u -o cpu -S -n 15</code><br />
Edit the number &#8220;15&#8243; at the end of the string to display more or less processes.</p>
<h3>Local Time</h3>
<p><code>date +%H:%M</code><br />
You can change the format in which the date is displayed using <a href="http://linux.die.net/man/3/strftime">these nifty conversion symbols</a>.</p>
<h3>Non-Relative Time</h3>
<p><code>TZ=Pacific/Honolulu date +"Honolulu: %H:%M"</code><br />
To change the timezone, edit the TZ variable above to something like &#8220;America/Los_Angeles&#8221; &#8211; a full list of possible TZ variables can be found here:<br />
<a href="http://twiki.org/cgi-bin/xtra/tzdatepick.html">http://twiki.org/cgi-bin/xtra/tzdatepick.html</a></p>
<h3>Calendar</h3>
<p><code>cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"</code>
</p>
<p><h2>My Exact GeekTool Setup</h2>
<p>Want to completely copy my style? Be my guest!</p>
<h3>Colors and Font</h3>
<p>White &#8211; Monaco<br />
The font size is variable depending upon the component &#8211; it varies from 9, the uptime and system processes, to 71, the local time.</p>
<h3>Text</h3>
<p>Right-justified</p>
<h3>Image Background</h3>
<p>I can&#8217;t remember where I download the background from, but it&#8217;s called &#8220;Flow&#8221; and it insanely rules. (If you know to whom I should give credit, please let me know.)<br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2009/03/flow_bg.zip'>Download Flow (~3MB)</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2009/03/17/easily-pimp-your-mac-os-x-desktop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I Drove Through Fire (Yesterday)</title>
		<link>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/</link>
		<comments>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 18:55:42 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=75</guid>
		<description><![CDATA[It&#8217;s not everyday that you see a car in flames &#8211; it&#8217;s also somewhat rare to drive through fire. Yesterday, I killed two birds with one fiery stone. Read the entire story after the jump.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not everyday that you see a car in flames &#8211; it&#8217;s also somewhat rare to drive through fire. Yesterday, I killed two birds with one fiery stone. Read the entire story after the jump.</p>
<p><span id="more-75"></span><br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2008/07/drove_through_fire.png'><img src="http://labs.iamkoa.net/wp-content/uploads/2008/07/drove_through_fire.png" alt="" title="drove_through_fire" width="447" height="795" class="alignnone size-full wp-image-76" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TinyMCE &amp; Mootools Ajax.Form Class &#8211; Feel The Love</title>
		<link>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/</link>
		<comments>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/#comments</comments>
		<pubDate>Sat, 31 May 2008 18:34:47 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[tinymce]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=74</guid>
		<description><![CDATA[TinyMCE (Tiny) is regarded as one of the best open source, HTML WYSIWYG editors of our time &#8211; it&#8217;s powerful, relatively easy for browsers to digest, and free to use. The frustrations of using Tiny arise when you attempt to submit your Tiny-enhanced form via Ajax. Because your Tiny textarea inputs are converted to a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tinymce.moxiecode.com/">TinyMCE</a> (Tiny) is regarded as one of the best open source, HTML WYSIWYG editors of our time &#8211; it&#8217;s powerful, relatively easy for browsers to digest, and free to use. The frustrations of using Tiny arise when you attempt to submit your Tiny-enhanced form via Ajax. Because your Tiny <code>textarea</code> inputs are converted to a mess of divs, spans, iframes, etc, <a href="http://demos.mootools.net/Ajax.Form">Mootools Ajax.Form</a> class fails to recognize the textarea. Fear not, there&#8217;s an easy workaround.</p>
<p><span id="more-74"></span></p>
<h2>The Workaround</h2>
<p>Below is a simple Javascript function you can use to convert Tiny-enhanced textareas back into regular form textareas:</p>
<pre class="brush:js">
var fixTiny = function(properties) {
	var properties = properties || new Object();
	var instance = properties.instance || 'mce_editor_0';
	tinyMCE.execInstanceCommand(instance,'mceCleanup');
	tinyMCE.triggerSave(true,true);
	return true;
}
</pre>
<h2>Using The Goods</h2>
<p>Using the above Javascript function is easy. Let&#8217;s assume we&#8217;re submitting two TinyMCE-enhanced textareas named &#8220;excerpt&#8221; and &#8220;body&#8221;, in a form with the id &#8220;myForm&#8221;. Here&#8217;s how to submit the form:</p>
<p>(The form submit code is taken directly from <a href="http://demos.mootools.net/Ajax.Form">this Mootools demos page</a>. Please refer to that page for further Ajax.Form reference.)</p>
<pre class="brush:js">
$('myForm').addEvent('submit', function(e) {
	/**
	 * Prevent the submit event
	 */
	new Event(e).stop();

	fixTiny({instance:'excerpt'});
	fixTiny({instance:'body'});

	/**
	 * This empties the log and shows the spinning indicator
	 */
	var log = $('log_res').empty().addClass('ajax-loading');

	/**
	 * send takes care of encoding and returns the Ajax instance.
	 * onComplete removes the spinner from the log.
	 */
	this.send({
		update: log,
		onComplete: function() {
			log.removeClass('ajax-loading');
		}
	});
});
</pre>
<p>All of this code, including the <code>fixTiny</code> function should be placed within a <code>domready</code> event.</p>
<h2>Simple, Right?</h2>
<p>If I&#8217;ve missed anything, shout at me. You can also refer to the <a href="http://forum.mootools.net/">Mootools forums</a> for further examples of using both TinyMCE and the Ajax.Form class. </p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
