<?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>k3vin.net</title>
	<atom:link href="http://www.k3vin.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.k3vin.net</link>
	<description>Coding, Design, Writing and All-Around Awesome</description>
	<lastBuildDate>Tue, 17 Jan 2012 08:09:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Look At CSS Sprites</title>
		<link>http://www.k3vin.net/2012/01/a-look-at-css-sprites/</link>
		<comments>http://www.k3vin.net/2012/01/a-look-at-css-sprites/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 08:09:26 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Designing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=219</guid>
		<description><![CDATA[A Little Background&#8230; Of all the tools in my Web Developer&#8217;s Toolkit™, perhaps the most used, and the most useful, is a trick called the CSS Sprite. It&#8217;s an &#8220;advanced&#8221; technique that is actually deceptively simple, and leads to fantastic advantages in loading times of web pages. First, a quick primer. A &#8220;sprite&#8221; doesn&#8217;t refer [...]]]></description>
			<content:encoded><![CDATA[<h2>A Little Background&#8230;</h2>
<p>Of all the tools in my Web Developer&#8217;s Toolkit™, perhaps the most used, and the most useful, is a trick called the CSS Sprite. It&#8217;s an &#8220;advanced&#8221; technique that is actually deceptively simple, and leads to fantastic advantages in loading times of web pages.</p>
<p>First, a quick primer. A &#8220;sprite&#8221; doesn&#8217;t refer to a carbonated soft-drink, or a mythical fairy. It&#8217;s an archaic computer term that simply refers to a graphic, stored in memory, that can be drawn on the screen. Old video games would define regions of memory (later called a &#8220;sprite sheet&#8221;) that contain the individual frames of an animation, and by cycling through these regions, the objects on screen would appear to animate.</p>
<div id="attachment_220" class="wp-caption aligncenter" style="width: 394px"><img class="size-full wp-image-220  " title="mario" src="http://www.k3vin.net/wp-content/uploads/mario.gif" alt="" width="384" height="152" /><p class="wp-caption-text">A sprite sheet (left) and the resulting animation (right). Super Mario is registered trademark of Nintendo Co., Ltd.</p></div>
<p>The relationship between video games becomes clearer when you think about these sprite sheets. Instead of producing an animation, we can use the technique to reduce code complexity, decrease loading times, improve accessibility, optimize the site for search engines, and provide a &#8220;rollover&#8221; effect (making the image appear to change when the user moves the mouse over it).</p>
<h2>Getting Started</h2>
<p>The first step is identifying the images. In the screenshot below, I&#8217;ve highlighted the items that I would replace with sprites on my company&#8217;s new web site. It&#8217;s important to note that these are <strong><em>layout elements</em></strong>. They are not a part of the content of the page, and will not change as frequently.</p>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.k3vin.net/wp-content/uploads/chilicode-sprites1.jpg"><img class="size-medium wp-image-225" title="chilicode-sprites" src="http://www.k3vin.net/wp-content/uploads/chilicode-sprites1-300x251.jpg" alt="" width="300" height="251" /></a><p class="wp-caption-text">Click to Embiggen</p></div>
<p>In this image, the logo in the top left, styled text in the middle, and button will have better accessibility and search engine friendliness. The icons in the top right and center of the page will have improved loading times, and the large chili will benefit from easier positioning and smoother rendering.</p>
<p>You&#8217;ll notice I didn&#8217;t highlight the portfolio thumbnails in the bottom right. This is because these images are dynamically inserted by a script, and therefore likely to change. Making them sprites would make them harder to manage in the future.</p>
<h2>The Markup</h2>
<p>Now that we&#8217;ve identified our images, it&#8217;s time to write the structure of the page in (X)HTML. Essentially, you can treat every element as if it were a piece of text, as the text will be replaced with images when the page is displayed.</p>
<p>Here is the markup for the very top bar, where the logo and social networking icons are displayed.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;h1&gt;&lt;a href=&quot;#&quot; id=&quot;logo&quot;&gt;Chili Code Solutions&lt;/a&gt;&lt;/h1&gt;
&lt;ul id=&quot;social-networks&quot;&gt;
	&lt;li&gt;
		&lt;a href=&quot;#&quot; id=&quot;facebook&quot; title=&quot;Join us on Facebook&quot;&gt;
			Join us on Facebook
		&lt;/a&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;a href=&quot;#&quot; id=&quot;twitter&quot; title=&quot;Follow us on Twitter&quot;&gt;
			Follow us on Twitter
		&lt;/a&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;a href=&quot;#&quot; id=&quot;linkedin&quot; title=&quot;Connect on LinkedIn&quot;&gt;
			Connect with us on LinkedIn
		&lt;/a&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>On a text-only browser, assistive screen reader, or search engine robot, these elements will be displayed as text. Accessible and search engine optimized in one fell swoop!</p>
<h2>The Stylesheet</h2>
<p>To replace the text with an image, we need to use a little CSS magic. This code is proven to work in all but the most obscure browsers.</p>
<pre class="brush: css; title: ; notranslate">
/* For the logo */
#logo {
	display: block;
	text-indent: -9999px; /* Move the text left 9999px */
	overflow: hidden; /* Hide elements outside the block */
	width: 240px; /* Width of image */
	height: 40px; /* Height of image */
	/* Image */
	background-image: url('images/logo.png');
	background-repeat: no-repeat;
}
</pre>
<p>This demonstrates the basic principle, but it is not a CSS sprite. The web browser will still make an HTTP request to load the image if it isn&#8217;t cached, and there will be no performance benefit.</p>
<h2>Real Sprites</h2>
<p>The social networking icons are best implemented as true CSS sprites. We can reduce load times, as well as create a rollover effect.</p>
<p>The sprite image is a combination of all the images, arranged into one, similar to the following:</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 124px"><img class="size-full wp-image-228" title="Social Network Sprites" src="http://www.k3vin.net/wp-content/uploads/sprite.png" alt="" width="114" height="68" /><p class="wp-caption-text">The top row is normal, the bottom is for the mouse-over state.</p></div>
<p>The idea is we&#8217;ll use the background-position CSS property, to position the background inside the visible area.</p>
<div id="attachment_229" class="wp-caption aligncenter" style="width: 262px"><img class="size-full wp-image-229" title="sprite-2" src="http://www.k3vin.net/wp-content/uploads/sprite-2.jpg" alt="" width="252" height="120" /><p class="wp-caption-text">Left: Normal style. Right: mouse-over style.</p></div>
<pre class="brush: css; title: ; notranslate">
/* For the facebook icon */
#facebook {
	display: block;
	text-indent: -9999px; /* Move the text left 9999px */
	overflow: hidden; /* Hide elements outside the block */
	width: 34px; /* Width of image */
	height: 34px; /* Height of image */
	/* Image */
	background: url('images/social-networks.png');
	background-repeat: no-repeat;
	background-position: 0px 0px; /* Position Image */
}
#facebook:hover {
	background-position: 0px -34px; /* Position Image */
}
</pre>
<p>Now, when the image is hovered, the background position will change, and the &#8220;over&#8221; state will be displayed.<br />
By combining the Facebook, Twitter, and LinkedIn into one image, you can reduce the number of HTTP requests, and simply position the background image.</p>
<pre class="brush: css; title: ; notranslate">
/* Combine into one definition */
#social-networks a {
	display: block;
	text-indent: -9999px; /* Move the text left 9999px */
	overflow: hidden; /* Hide elements outside the block */
	width: 34px; /* Width of image */
	height: 34px; /* Height of image */
	/* Image */
	background: url('images/social-networks.png');
	background-repeat: no-repeat;
}
/* Facebook */
#facebook {
	background-position: 0px 0px; /* Position Image */
}
#facebook:hover {
	background-position: 0px -34px; /* Position Image */
}
/* Twitter */
#twitter {
	background-position: -34px 0px; /* Position Image */
}
#twitter {
	background-position: -34px -34px; /* Position Image */
}
/* LinkedIn */
#linkedin {
	background-position: -68px 0px; /* Position Image */
}
#linkedin:hover {
	background-position: -68px -34px; /* Position Image */
}
</pre>
<p>The end result? Instead of loading 6 separate images, it loads one. Using background-position to display the area of the image, depending on the id of the element. It&#8217;s re-usable code, and it&#8217;s accessible, efficient, search-engine friendly.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2012/01/a-look-at-css-sprites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QR Codes</title>
		<link>http://www.k3vin.net/2011/07/qr-codes/</link>
		<comments>http://www.k3vin.net/2011/07/qr-codes/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 22:53:41 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Software, Hardware & Tools]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=206</guid>
		<description><![CDATA[QR Codes are becoming more and more visible these days, appearing everywhere from magazines, to bus stop ads. They even had a dancer hold up a giant QR Code in Stephen Colbert&#8217;s hilarious rendition of Rebecca Black&#8217;s &#8220;Friday&#8221;. They&#8217;re a useful tool that can help connect the physical world to the virtual one. A QR [...]]]></description>
			<content:encoded><![CDATA[<p>QR Codes are becoming more and more visible these days, appearing everywhere from magazines, to bus stop ads. They even had a dancer hold up a giant QR Code in <a href="http://www.youtube.com/watch?v=fSAwOcFr_VE&amp;feature=player_detailpage#t=225s" target="_blank">Stephen Colbert&#8217;s hilarious rendition of Rebecca Black&#8217;s &#8220;Friday&#8221;</a>. They&#8217;re a useful tool that can help connect the physical world to the virtual one.</p>
<p>A QR Code is basically a way of encoding text, and works in exactly the same way as the bar codes at the supermarket. Instead of being vertical lines, and read with a laser, the data is displayed on a grid, and read using the cameras in your smartphone. The name &#8220;QR Code&#8221; is short for &#8220;Quick Response Code&#8221;, due to the fact that they were designed to be instantly readable, even on low-power, embedded devices like &#8220;feature&#8221; phones.</p>
<p>If you want to make your own QR Codes, or use them in a project, there are a number of resources that make it easy to do.</p>
<p>First, take a look at this QR Code generator, at delivr: <a href="http://delivr.com/qr-code-generator">http://delivr.com/qr-code-generator</a></p>
<p>Using this, you can create a QR Code to be used in your project. Just choose the kind of code, enter your data, and click &#8220;Generate QR Code&#8221;!</p>
<p>If you need some more details on how they work, and how to make your own, take a look at the <a href="http://en.wikipedia.org/wiki/Qr_code" target="_blank">Wikipedia page on QR Codes</a>, which provide information on how the encoding works, and how you can generate codes manually in your project.</p>
<p>Finally, a neat trick I noticed: Google automatically displays QR Codes as download links on Google Code, for example: <a href="http://code.google.com/p/swfobject/downloads/detail?name=swfobject_2_2.zip" target="_blank">here</a>.</p>
<p>This means that Google QR Codes are being automatically generated for each download link. Knowing this, we can use Google&#8217;s Charts API (which is used to generate the codes) to provide quick and easily generated codes wherever they&#8217;re needed.</p>
<p>The format of the URL is as follows: https://www.google.com/chart?cht=qr&amp;chld=L|1&amp;chs=&lt;width&gt;x&lt;height&gt;&amp;chl=&lt;content&gt;</p>
<p>Simply replace &lt;width&gt; &amp; &lt;height&gt; with the size of the image you want (From about 25&#215;25 pixels and up), and the &lt;content&gt; with a URL-encoded string of your choice. Google will return a QR Code with the details you specified, ready for embedding.</p>
<p>From personal experience, QR Codes can be a great way to attract customers if used properly, and I expect they will explode in popularity within the coming years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/07/qr-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The iPad 2</title>
		<link>http://www.k3vin.net/2011/04/the-ipad-2/</link>
		<comments>http://www.k3vin.net/2011/04/the-ipad-2/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 07:57:08 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Software, Hardware & Tools]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=200</guid>
		<description><![CDATA[It&#8217;s no secret now, but in case you missed it, yes, I bought an iPad 2. After using it for a few days, and getting to know this shiny rectangular piece of modern technology, I feel qualified to share of my impressions of the device. Typing is actually pretty easy. In landscape orientation, anyways. Portrait is [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s no secret now, but in case you missed it, yes, I bought an iPad 2. After using it for a few days, and getting to know this shiny rectangular piece of modern technology, I feel qualified to share of my impressions of the device.</p>
<ol>
<li>Typing is actually pretty easy. In landscape orientation, anyways. Portrait is a different matter entirely, and the on-screen keyboard is just too small, but since every app rotates to accomodate how you want to view it, I don&#8217;t consider this an issue. While I haven&#8217;t measured my typing speed quantitatively, I can say I&#8217;m almost as fast on the on-screen keyboard as I am with my laptop&#8217;s keys. This makes writing my science fiction story, or an email, or even a comment on a website a reasonably pleasant experience.</li>
<li>It&#8217;s heavy. I shudder to think of the wrist-mangling weight that the original iPad carried, but the first thing you think about with this model is how sore your wrists might be after anything more than 10 minutes of use. In practice, it&#8217;s not as bad as I had originally thought, since I usually find something to rest it on fairly quickly (my lap or knees being the most common places) but it still takes some time to figure out.</li>
<li>The iPad isn&#8217;t just a big iPod Touch. The extra screen makes so much of a difference it&#8217;s frightening. Suddenly you can see the big picture. Look at several things at once, and not have to squint at the tiny (but Retina™ clear!) text that the iPhone would display. Apps on the iPhone feel tiny and cramped by comparison, and I find myself reaching for the iPad to do some of the things I would have done on my iPhone before.</li>
<li>It&#8217;s making me paranoid. Is that guy on the bus going to jump me the moment I get off and steal it? Probably not, but as is true with any expensive new shiny gadget, I am immediately aware of the possibility for it getting stolen. I run through horror stories in my head whenever I&#8217;m in the downtown east-side (which I walk through every day on the way to work). I remember the stories of the person who got their finger torn off when a thief yanked a bag containing a new iPad out of their hands. Not fun.</li>
<li>This is the #&amp;%$*^ future. I think about this every time I pick up the iPad. Remember &#8220;Star Trek: The Next Generation&#8221; where everyone had these little handheld devices that did anything the show required of them? This is that. This is more than that. This is like the Hitchhiker&#8217;s Guide, and then some. My mind is constantly being blown at how far technology has advanced in the last few years, and the iPad 2 is the perfect example of that. I can stream movies, send e-mails, browse the web, play games&#8230; all at the flick of a finger. The new iOS software incorporates gestures that make performing simple tasks, such as closing an app, feel so natural and intuitive, I&#8217;ve often wondered why they haven&#8217;t appeared elsewhere before now.</li>
</ol>
<p>Now, is the iPad worthy of being called &#8220;magical&#8221;? Probably not. What is is though, is a well-designed device that excels in ease-of-use. So far, it seems to fit my needs just fine, and is a lot more natural than the awkward netbook that it replaced. Overall, I&#8217;m fairly impressed with it, and I am looking forward to using it to its full potential, and even developing my own apps to make use of the unique hardware and software.</p>
<p>My model: Wi-Fi only, 32GB flash memory, black.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/04/the-ipad-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOSSecret</title>
		<link>http://www.k3vin.net/2011/03/iossecret/</link>
		<comments>http://www.k3vin.net/2011/03/iossecret/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 08:15:40 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=190</guid>
		<description><![CDATA[I&#8217;ve been learning to develop for the iOS platform, so I&#8217;ve got some really neat stuff in the works. The first of which is an app that d3IÖn6ëî&#38;µ¥äâÑ*ÞEí¡ÿzðERROR]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been learning to develop for the iOS platform, so I&#8217;ve got some really neat stuff in the works. The first of which is an app that d3IÖn6ëî&amp;µ¥äâÑ*ÞEí¡ÿzðERROR</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/03/iossecret/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Wallpaper 3: Robots Don&#8217;t Need Moustaches</title>
		<link>http://www.k3vin.net/2011/03/weekly-wallpaper-3-robots-dont-need-moustaches/</link>
		<comments>http://www.k3vin.net/2011/03/weekly-wallpaper-3-robots-dont-need-moustaches/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 08:07:58 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Desktop Wallpapers]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=182</guid>
		<description><![CDATA[Author: Kevin Smith / Artwork by Divide By Zero, Picnik Dimensions: 1680×1050 License: CC BY-NC-SA 2.5 Download: here While exploring the APIs and functionality of a nifty online image editing service called Picnik, I created this funny little doodle out of their provided clip-art. My co-workers liked it so much I just had to make [...]]]></description>
			<content:encoded><![CDATA[<p>Author: Kevin Smith / Artwork by <a href="http://fonts.tom7.com/">Divide By Zero</a>, <a href="http://www.picnik.com/">Picnik</a><br />
Dimensions: 1680×1050<br />
License: <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ca/">CC BY-NC-SA 2.5</a><br />
Download: <a href="http://www.k3vin.net/?attachment_id=183" target="_self">here</a></p>
<p>While exploring the APIs and functionality of a nifty online image editing service called <a href="http://www.picnik.com/">Picnik</a>, I created this funny little doodle out of their provided clip-art. My co-workers liked it so much I just had to make it into a full-size wallpaper. Here is the result.</p>
<p>I could not find any terms of use or licensing information for the artwork provided by either Divide By Zero or Picnik, additionally, neither party has made contact details available. I am therefore under the assumption that artwork provided is in the Public Domain, and my re-licensing and re-distribution of a derivative work under a creative commons license is lawful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/03/weekly-wallpaper-3-robots-dont-need-moustaches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abusing t.co for Fun and Profit</title>
		<link>http://www.k3vin.net/2011/03/abusing-tco-for-fun-and-profit/</link>
		<comments>http://www.k3vin.net/2011/03/abusing-tco-for-fun-and-profit/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 07:34:15 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=171</guid>
		<description><![CDATA[Ah, yes. t.co. That amazingly tiny url shortening service created by Twitter when they decided that they wanted to alienate and abandon all the 3rd party developers who helped make them into the powerhouse social networking service that they are today. Using t.co has big advantages on Twitter, too: the original link is shown when [...]]]></description>
			<content:encoded><![CDATA[<pre></pre>
<p>Ah, yes. t.co. That amazingly tiny url shortening service created by Twitter when they decided that they wanted to alienate and abandon all the 3rd party developers who helped make them into the powerhouse social networking service that they are today. Using t.co has big advantages on Twitter, too: the original link is shown when the twitter post is viewed on the website, but the link only counts for 20 characters max. Twitter also provides security features, so that if a link contains potentially dangerous content, a user will be notified as such beforehand.</p>
<p>A link of 20 characters is one of the shortest of the URL-shortening services I&#8217;ve ever seen. It would be fantastic if we could use them elsewhere, would it not?</p>
<p>So here&#8217;s a nifty trick to generate a t.co URL without actually posting it to Twitter. You can do this in any language and on any platform that can make HTTP requests (and it helps if you can filter the result using regular expressions). You will, however, need a twitter account to make this work, and therefore I do not recommend using this method in a professional, production environment. Twitter has Developer API keys for that. I use this method for quick, easy scripts: anything that occasionally needs a short URL.</p>
<p>In essence, Twitter has a &#8220;share&#8221; service, that you can use to share a website. This includes passing the URL in the query parameter (where it is shortened and added to your message), entering a &#8220;tweet&#8221;, and posting it to your account. The fact that it is shortened BEFORE you post is what we&#8217;re going to take advantage of.</p>
<p>To make these requests from a web script, I recommend using one of my favorite PHP libraries: <a href="http://sourceforge.net/projects/snoopy/" target="_blank">Snoopy</a>! Snoopy is a web request library with support for redirection and cookies, which is what makes it so useful. I&#8217;ve used it many times in the past, and it has more than proven its worth. I won&#8217;t go into other languages or implementations, but it should be pretty straightforward.</p>
<p>Take a look at the script below:</p>
<pre class="brush: php; title: ; notranslate">
include 'Snoopy.class.php';
$link = &quot;http://www.google.ca&quot;;
$http = new Snoopy();
$http-&gt;maxredirs = 0;
$http-&gt;submit(&quot;http://twitter.com/share&quot;, array(
		'url' =&gt; $link,
		'session[username_or_email]' =&gt; '&lt;YOUR-TWITTER-ACCT&gt;',
		'session[password]' =&gt; '&lt;YOUR-TWITTER-PW&gt;',
		'commit' =&gt; 'Sign in'
	));
$html = $http-&gt;results;
</pre>
<p>What this does is log you in with your twitter account, and pass the /share service the link you want to send. The result will be a webpage with the share box containing your shortened url (among a lot of other form fields, images, text, and things we don&#8217;t care about).</p>
<p>To extract the fields, I used a handy loop and some regex. This can definitely be done in a simpler way, but I wanted to be thorough, and account for possible changes in the resulting /share page.</p>
<pre class="brush: php; title: ; notranslate">
$fields = array();
$matches = array();
preg_match_all('/&lt;input([^&gt;]+)&gt;/', $html, $matches,
	PREG_PATTERN_ORDER,
	strpos($html, 'action=&quot;/share/update&quot;')
);
foreach($matches[1] as $match)
{
	$name = array(); $value = array();
	if(preg_match('/name=[&quot;\']([^&quot;\']+)[&quot;\']/',
			$match, $name)
		&amp;&amp; preg_match('/value=[&quot;\']([^&quot;\']+)[&quot;\']/',
			$match, $value))
	{
		$fields[trim($name[1])] = trim($value[1]);
	}
}
unset($matches);
</pre>
<p>At the end of all this, $fields will contain something that looks like this:</p>
<pre class="brush: plain; title: ; notranslate">
Array
(
    [authenticity_token] =&gt; somelongstringiprobablyshouldntshare
    [url] =&gt; http://www.google.com
    [shortened_url] =&gt; http://t.co/0vYtROQ
)
</pre>
<p>Just look! We have just obtained a t.co URL without having to post to Twitter! You can now use this URL for whatever purposes you wish, such as, but not limited to repeatedly tricking your friends and coworkers into watching Rick Astley&#8217;s &#8220;Never Gonna Give You Up&#8221; (<a href="http://t.co/aSObE9L">http://t.co/aSObE9L</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/03/abusing-tco-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Wallpaper 2: Light Room</title>
		<link>http://www.k3vin.net/2011/03/weekly-wallpaper-2-light-room/</link>
		<comments>http://www.k3vin.net/2011/03/weekly-wallpaper-2-light-room/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 21:35:21 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Desktop Wallpapers]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=162</guid>
		<description><![CDATA[Author: (original) siwy7 / (modified) Kevin Smith Dimensions: 1680×1050 License: GPL Download: here The original light-room wallpaper is amazing, since it makes the desktop feel much bigger than it actually is &#8212; like a window into a vast, digital world. This wallpaper was never updated for high-resolution widescreen displays, so I&#8217;ve taken it upon myself [...]]]></description>
			<content:encoded><![CDATA[<p>Author: (original) <a href="http://gnome-look.org/usermanager/search.php?username=siwy78" target="_blank">siwy7</a> / (modified) Kevin Smith<br />
Dimensions: 1680×1050<br />
License: <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">GPL</a><br />
Download: <a href="http://www.k3vin.net/?attachment_id=163" target="_self">here</a></p>
<p>The original light-room wallpaper is amazing, since it makes the desktop feel much bigger than it actually is &#8212; like a window into a vast, digital world. This wallpaper was never updated for high-resolution widescreen displays, so I&#8217;ve taken it upon myself to clean it up. Removed a lot of JPG compression artifacts, and adjusted it to a widescreen aspect ratio using a special technique to reduce the appearance of stretching or distortion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/03/weekly-wallpaper-2-light-room/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Wallpaper 1: Pac Man</title>
		<link>http://www.k3vin.net/2011/02/weekly-wallpaper-1-pac-man/</link>
		<comments>http://www.k3vin.net/2011/02/weekly-wallpaper-1-pac-man/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 10:43:55 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Desktop Wallpapers]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=154</guid>
		<description><![CDATA[Author: Kevin Smith Dimensions: 1680&#215;1050 License: CC BY-NC-SA 2.5 Download: here A while ago, I came across some Pac Man wallpapers, and didn&#8217;t like any of them. Most people (Namco included, apparently) decided the retro arcade look modernizes into neon lights. While it works on some levels, neon lights don&#8217;t make a particularly good wallpaper. [...]]]></description>
			<content:encoded><![CDATA[<p>Author: Kevin Smith<br />
Dimensions: 1680&#215;1050<br />
License: <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ca/"></a><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ca/">CC BY-NC-SA 2.5</a><br />
Download: <a href="http://www.k3vin.net/?attachment_id=155">here</a></p>
<p>A while ago, I came across some Pac Man wallpapers, and didn&#8217;t like any of them. Most people (<a href="http://namco.com/ios/pac-man-championship-edition" target="_blank">Namco included</a>, apparently) decided the retro arcade look modernizes into neon lights. While it works on some levels, neon lights don&#8217;t make a particularly good wallpaper. I decided to make my own, and combine mat colours with subtle glow and reflections.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/02/weekly-wallpaper-1-pac-man/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Mis)adventures with AppleScript</title>
		<link>http://www.k3vin.net/2011/02/misadventures-with-applescript/</link>
		<comments>http://www.k3vin.net/2011/02/misadventures-with-applescript/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 21:18:18 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software, Hardware & Tools]]></category>

		<guid isPermaLink="false">http://www.k3vin.net/?p=127</guid>
		<description><![CDATA[Since I switched to the Mac, there&#8217;s one thing I&#8217;ve constantly avoided: AppleScript. While I&#8217;ve used programs that support it, and used scripts in the past, I&#8217;ve never found a reason to roll up my sleeves and dig into the code. Here are a couple of reasons for my aversion to AppleScript. Syntax is overly [...]]]></description>
			<content:encoded><![CDATA[<p>Since I switched to the Mac, there&#8217;s one thing I&#8217;ve constantly avoided: AppleScript. While I&#8217;ve used programs that support it, and used scripts in the past, I&#8217;ve never found a reason to roll up my sleeves and dig into the code. Here are a couple of reasons for my aversion to AppleScript.</p>
<ol>
<li><strong>Syntax is overly verbose</strong> &#8211; This is great <em>in theory</em> because you&#8217;d expect your code to read like natural language, and it&#8217;d be easier to understand. In practice, the code is hard to read, because it forces strict, programming-like syntax that breaks the flow of the language, and makes it seem awkward.</li>
<li><strong>It reminds me of VBScript</strong> &#8211; Like VBScript, AppleScript allows you to automate tasks in, and between applications. They even share similar syntax with &#8220;if &#8230; then &#8230; end if&#8221; blocks. Why is this bad? To put it quite simply, VBScript has made Microsoft Office a nightmare to work with, with embedded scripts that reference missing files, written by people who don&#8217;t know what they&#8217;re doing and shouldn&#8217;t be using a computer, let alone a scripting language. Thankfully this is less of a concern in Mac OS X, but my point still stands. VBScript gives me nightmares. Reminding me of it is probably not the best idea.</li>
<li><strong>Command-line is more powerful</strong> &#8211; Why would I want to learn a new scripting language, when Shell Scripting is much more powerful? Most of my experience with AppleScripts have been &#8220;Get input from user. Run shell script with input. Exit.&#8221;. Apple Script becomes just a friendly GUI wrapper for a command-line utility.</li>
</ol>
<p>So despite all of this, I decided to adapt a command-line script into a little utility that can change the extension of a group of files. I may not like AppleScript, but it has proven to be pretty handy in this scenario.</p>
<p>Some Google searches got me most of the code, and after a little tweaking, I can present to you: <a rel="attachment wp-att-128" href="http://www.k3vin.net/2011/02/misadventures-with-applescript/batch-change-extension/">Batch Change Extension</a>.</p>
<p>Run it, and it will ask you for the files (multiple-select file open dialog), and the new extension. Simple enough. You can also use it like a droplet, and drag &amp; drop the files you want to change onto it. In this case, it asks for extension only.</p>
<p>Download Here: <a rel="attachment wp-att-128" href="http://www.k3vin.net/2011/02/misadventures-with-applescript/batch-change-extension/">Batch Change Extension</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/02/misadventures-with-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social Bliss: Twitterrific &amp; Sparrow</title>
		<link>http://www.k3vin.net/2011/02/social-bliss-twitterrific-sparrow/</link>
		<comments>http://www.k3vin.net/2011/02/social-bliss-twitterrific-sparrow/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 23:57:28 +0000</pubDate>
		<dc:creator>Kevin Smith</dc:creator>
				<category><![CDATA[Software, Hardware & Tools]]></category>

		<guid isPermaLink="false">http://k3vin.chilicode.ca/?p=107</guid>
		<description><![CDATA[Not dead, just busy! I&#8217;m starting a development company, but you&#8217;ll hear more on that later. Right now, I&#8217;d like to draw your attention to two really fantastic applications for Mac OS X: Twitterrific and Sparrow Twitterrific I got the original version of Twitterrific a while ago in a MacHeist Bundle, and while it was [...]]]></description>
			<content:encoded><![CDATA[<p>Not dead, just busy! I&#8217;m starting a development company, but you&#8217;ll hear more on that later.</p>
<p>Right now, I&#8217;d like to draw your attention to two really fantastic applications for Mac OS X: <a href="http://twitterrific.com/">Twitterrific</a> and <a href="http://www.sparrowmailapp.com/">Sparrow</a></p>
<h2><a href="http://www.k3vin.net/wp-content/uploads/Twiterrific.jpg"><img class="alignright size-medium wp-image-120 shadow" title="Twiterrific" src="http://www.k3vin.net/wp-content/uploads/Twiterrific-146x300.jpg" alt="" width="146" height="300" /></a>Twitterrific</h2>
<p>I got the original version of Twitterrific a while ago in a <a href="http://www.macheist.com/">MacHeist</a> Bundle, and while it was good, it didn&#8217;t exactly stand out the way <a href="http://www.atebits.com/tweetie-mac/">Tweetie</a> did. I eventually stopped using it, and adopted Tweetie as my go-to Mac Twitter client.</p>
<p>Shortly afterwards, Tweetie (and developer Atebits) was acquired by Twitter.com, and all development stopped. Tweetie 2 (long promised) became Twitter for Mac, the official Mac client.</p>
<p>Now, anyone who&#8217;s seen me work, or at least seen my previous post (<a href="http://www.k3vin.net/2011/01/my-iograph-day/">My IO Graph Day</a>) knows how much I use spaces for Mac. The official Twitter for Mac client shipped with spaces <em>completely broken</em>. I don&#8217;t know if this is a result of using a non-standard window, or just an oversight, but for me, it&#8217;s a complete deal breaker.</p>
<p>They quickly tried to fix this, and proceeded to <em>make it even worse</em>. The official Twitter application follows me onto every space, and sits above other windows, and gets in my way. Since the original Tweetie lacks native retweet support, I was forced to deal with this horrible monstrosity for a while. I eventually stopped using it altogether, and started using the website again.</p>
<p>Then, as if the gods answered my pleas, a review of Twitterrific 4 shows up on my news feed from <a href="http://arstechnica.com/apple/news/2011/02/hands-on-with-twitterrific-40-for-mac.ars">Ars Technica</a>, and the verdict is pretty decent. Combine that with a $7.95 upgrade price, and you have a real winner.</p>
<h2><a href="http://www.k3vin.net/wp-content/uploads/Sparrow.jpg"><img class="alignright size-medium wp-image-121 shadow" title="Sparrow" src="http://www.k3vin.net/wp-content/uploads/Sparrow-300x173.jpg" alt="" width="300" height="173" /></a>Sparrow</h2>
<p>Next up: Sparrow. You&#8217;d think e-mail clients are pretty straightforward these days. <a href="http://www.apple.com/macosx/what-is-macosx/mail-ical-address-book.html">Mail.app</a> for Mac OS X is pretty standard. It supports a lot of mail accounts, and comes bundled with new Macs. If you&#8217;re looking for a more feature-filled mail client, <a href="http://www.microsoft.com/mac/outlook">Outlook</a> (bundled with Microsoft Office) handles the job nicely, integrating calendars, contacts, and improved Exchange support.</p>
<p>But Sparrow is a case where outstanding design trumps features. Sparrow is basically a desktop GMail client. It uses GMail&#8217;s built-in IMAP syncing for e-mail, and currently only supports GMail (although standard IMAP support is coming). It takes a lot of cues from Tweetie and <a href="http://www.apple.com/ipad/ios4/">iOS</a> for the user interface, and basically presents e-mail as a social stream. This idea works on so many levels, I can&#8217;t fathom why nobody else has done it this way.</p>
<p>Add to that the convenient widescreen-friendly dual-pane view, and a simple task like checking e-mail becomes a wonderful thing.</p>
<p>My main gripe is the lack of option to disable loading of remote images, but I&#8217;ve worked around this pretty well using <a href="http://www.obdev.at/products/littlesnitch/index.html">Little Snitch</a> to allow Sparrow access to GMail&#8217;s servers only.</p>
<p>Sparrow retails for $9.99, and is the first of what I hope will be many more applications inspired by the simplicity and ease-of-use of iOS applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.k3vin.net/2011/02/social-bliss-twitterrific-sparrow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

