<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Kilian Valkhof</title>
	
	<link>http://kilianvalkhof.com</link>
	<description />
	<lastBuildDate>Mon, 23 Aug 2010 08:00:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Kilianvalkhofcom" /><feedburner:info uri="kilianvalkhofcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The case of the disappearing favicon</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/yAO095HCoCQ/</link>
		<comments>http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 08:00:37 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=772</guid>
		<description><![CDATA[<blockquote><p>Luckily, there is an easy fix: Just reset the favicon</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/">The case of the disappearing favicon</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Firefox has an annoying bug: If you set the <code>window.location.hash</code>, your favicon disappears. <em>Very</em> annoying. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=519028">The bug</a> has been open and confirmed for a long time, and Firefox 3.0 all the way to 3.6 are affected. But it hasn&#8217;t been fixed yet, so here&#8217;s how to fix it yourself.<span id="more-772"></span></p>
<p>I encountered this bug while building <a href="http://lystener.com">Lystener</a>. I change the location hash there quite often, and each time I did, the favicon would disappear. Finding the root cause took me quite a while, and apart from the bug report I could not find any page describing why this happens and what to do about it. So I figured that I&#8217;d write a quick post about it to make it Google-able at least.</p>
<p>Luckily, there is an easy fix: Just reset the favicon after changing the <code>window.location.hash</code>. Here&#8217;s a jQuery function that does just that:</p>
<pre></code>function setFavicon() {
  var link = $('link[type=image/x-icon]').remove().attr("href");
  $('&lt;link href="'+ link +'" rel="shortcut icon" type="image/x-icon" /&gt;').appendTo('head');
}</code></pre>
<p>It&#8217;s fairly straightforward: We find the current <code>&lt;link&gt;</code> referencing the favicon, remove it, and then, making use of jQuery&#8217;s standard of functions returning themselves, get the href attribute of the just-deleted link. Then we simply set that as the <code>href</code> in a newly created <code>link</code> element, and add that to the head. </p>
<p>Just execute that function each time you change the <code>window.location.hash</code>, and you&#8217;re all set!</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/">The case of the disappearing favicon</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yAO095HCoCQ:uV0q2xzUZZE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yAO095HCoCQ:uV0q2xzUZZE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yAO095HCoCQ:uV0q2xzUZZE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yAO095HCoCQ:uV0q2xzUZZE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yAO095HCoCQ:uV0q2xzUZZE:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/yAO095HCoCQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/</feedburner:origLink></item>
		<item>
		<title>F.lux for Ubuntu</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/JRlYHF8aFrE/</link>
		<comments>http://kilianvalkhof.com/2010/linux/flux-for-ubuntu/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 07:00:42 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=735</guid>
		<description><![CDATA[<blockquote><p>F.lux for Ubuntu is an indicator applet (like the new Messaging Menu), so it works very nicely on Ubuntu 10.04 and 10.10</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/linux/flux-for-ubuntu/">F.lux for Ubuntu</a></p>
]]></description>
			<content:encoded><![CDATA[<p>F.lux is a small but very useful application: It fades your screens to a warmer color temperature in the evening. This is pleasant for your eyes and won&#8217;t leave you wide awake at 2am because your computer monitors are so bright. There are <a href="http://www.stereopsis.com/flux/">mac and windows versions</a>, but only a commandline app for Linux. Together with <a href="http://www.nerdblog.com/">Michael Herf</a>, the author of F.lux, I made a version for Ubuntu.<span id="more-735"></span></p>
<p>F.lux for Ubuntu is an indicator applet (like the new Messaging Menu), so it works very nicely on <strong>Ubuntu 10.04 and 10.10</strong>. Michael improved the commandline application by leaps and bounds. There are a bunch of new configuration options (all available in the GUI), the night/daytime cycle is now much more accurate, and it even takes daylight savings into account.</p>
<p>The F.lux indicator applet automatically manages the color temperature of your screen based on your latitude and longitude, or if you are in the US, your zipcode. In the preferences panel, you can set your preferred nighttime colortemperature and see a preview, as well as seeing the current color temperature.</p>
<p><img src="/uploads/f.lux.png" alt="Screenshot of the preference panel" style="float:right;margin-left:1em;" /></p>
<h2>Installation</h2>
<p>Installation is easily done by adding the PPA for f.lux, simply type the following into your terminal:</p>
<ol>
<li><code>sudo add-apt-repository ppa:kilian/f.lux</code></li>
<li><code>sudo apt-get update</code></li>
<li><code>sudo apt-get install fluxgui</code></li>
</ol>
<p>When you first launch the application (via &#8216;accessories&#8217; in the menu, or by pressing alt+f2 and opening &#8220;fluxgui&#8221;) you will be asked to fill in either your latitude and langitude, or your zipcode. If you want f.lux to autostart at the next startup, select the &#8220;autostart&#8221; option. Close the preferences panel and you&#8217;re all set!</p>
<p><strong>There is a bug in the current version of Fluxgui that&#8217;s preventing it from running correctly the first time it&#8217;s started. I wrote a fix that&#8217;ll be available in the PPA shortly (version 1.1.4).</strong> If you can&#8217;t start because fluxgui claims it&#8217;s already running, remove &#8220;fluxgui.pid&#8221; from the /tmp folder. After the update, it should work as advertised!</p>
<h3>On developing F.lux for Ubuntu</h3>
<p>As I mentioned, F.lux for Ubuntu is built using GTK+. This isn&#8217;t by choice, but needed because I wanted to built an indicator applet. </p>
<p>Coming from Python + Qt (for <a href="http://trimage.org">Trimage</a>) , GTK+ feels like a serious step back. The Glade interface builder is clunky and quirky, and surprisingly, modules such as python-gconf and python-appindicator are virtually undocumented. There is a <em>massive</em> amount of time spent on figuring out what-goes-where-and-how.</p>
<p>Nevertheless, I like Python more each time I use it, and going back to JavaScript often feels weird (&#8220;Oh, yes, parentheses!&#8221;) so I think it&#8217;s time to start doing more with <a href="http://jashkenas.github.com/coffee-script/">Coffeescript</a> in the future.</p>
<h3>Official announcement</h3>
<p>Michael posted an official announcement on the F.lux website with these instructions as well: <a href="http://stereopsis.com/flux/linux.html">f.lux for linux</a>, so be sure to go there and leave nice comments for us and tell us what we can improve! :)</p>
<h3>Future versions</h3>
<p>The currently released version is 1.1.1, For version 1.2 we will be adding a &#8220;pause for an hour&#8221; function, as well as an indication of how long until sunset/sunrise. Feel free to suggest other new features or fork the project on <a href="http://github.com/Kilian/f.lux-indicator-applet">Github</a>. It&#8217;s build using Python and GTK+, and the GUI is MIT licenced.</p>
<p>I&#8217;m quite proud of the result so far, and I hope it&#8217;ll be as useful to others as it already has been to me! Please leave suggestions for new features in the replies :)</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '28694';
var flattr_url = 'http://kilianvalkhof.com';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Kilian Valkhof';
var flattr_dsc = '';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/linux/flux-for-ubuntu/">F.lux for Ubuntu</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=JRlYHF8aFrE:VepgKdkchWA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=JRlYHF8aFrE:VepgKdkchWA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=JRlYHF8aFrE:VepgKdkchWA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=JRlYHF8aFrE:VepgKdkchWA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=JRlYHF8aFrE:VepgKdkchWA:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/JRlYHF8aFrE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/linux/flux-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/linux/flux-for-ubuntu/</feedburner:origLink></item>
		<item>
		<title>A web app in a weekend: Lystener.com</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/yTLBIIkL5v0/</link>
		<comments>http://kilianvalkhof.com/2010/web/a-web-app-in-a-weekend-lystener-com/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 06:00:14 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=711</guid>
		<description><![CDATA[<blockquote><p>Posting lyrics to Facebook and Twitter is something a lot of people do, and the process for that sucks</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/a-web-app-in-a-weekend-lystener-com/">A web app in a weekend: Lystener.com</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A week ago on Friday I woke up with a great idea for a web app. I wrote the entire idea down in a couple of minutes, <a href="http://twitter.com/kilianvalkhof/status/16453636010">tweeted</a> about it&#8230; and went to my grandma to fix her computer and talk about politics.<span id="more-711"></span> </p>
<h2>The idea</h2>
<p>Finding lyrics has been a longstanding pet-peeve of mine. A lot of music players don&#8217;t allow to you easily copy the title and artist so you have to manually type them into Google. Once you&#8217;re there, most sites are cluttered and spammy. Way too annoying.</p>
<p><a href="http://lystener.com">Lystener</a> asks you for your last.fm username, and then displays the lyrics to what you&#8217;re listening to. Simple but effective.</p>
<p>But that&#8217;s not the entire idea. Posting lyrics to Facebook and Twitter is something a lot of people do, and the process for that sucks, too: you had to find the lyrics via Google and the spammy sites I mentioned earlier, copy the part you like, paste it into the form on Twitter or Facebook, format it, add the title and artist and only then you&#8217;d be done. With Lystener, you just select the lyrics you like and Lystener takes care of the rest, leaving you to just click the &#8216;tweet&#8217; or &#8216;publish&#8217; button.</p>
<h2>Launch!</h2>
<div style="text-align:center">
<p><a style="border:0" href="http://lystener.com"><br />
<img src="http://lystener.com/media/stylesheets/../images/logo.png" alt="" /><br />Lystener.com</a></p>
</div>
<p>Go check it out! I&#8217;m pretty exited to see what everyone thinks, so please let me know. I have a whole bunch of ideas lined up to expand Lystener, but if you have ideas I&#8217;d love to hear them. To keep up with the updates, follow <a href="http://twitter.com/lystenerapp">@LystenerApp</a> on Twitter or like <a href="http://www.facebook.com/apps/application.php?id=138063006204033">Lystener on Facebook</a>.</p>
<p>Read on to know how I made it:</p>
<h2>The process</h2>
<p>After getting home I bought the domain name (I had thought up a name in that great moment when you&#8217;re not quite sleeping and not quite awake yet and everything is clear as glass.) and started sketching and coding. At the end of the day, the app was <a href="http://twitter.com/kilianvalkhof/status/16483662403">60% done</a> and after working on it for the entire Saturday, the <a href="http://twitter.com/kilianvalkhof/status/16558414720">minimum viable version</a> was done as well. I invited people for the &#8216;beta&#8217; and gave people access on Sunday, requesting feedback in the process.</p>
<p>That&#8217;s it, a web app in a weekend. What now?</p>
<p>The response under my beta testers was overwhelmingly positive, save for one thing: the lyrics themselves. I used an API that didn&#8217;t give full lyrics, and didn&#8217;t have a lot of songs, and was really error prone. It sucked. A website can work well technically, but if it doesn&#8217;t display what you want, or only partially displays it, it&#8217;s not useful.</p>
<p>So I decided to switch over to another API, the <a href="http://chartlyrics.com">chartlyrics</a> API. It had a lot more matches, it provided full lyrics and if lyrics were missing, they have options to easily add the lyrics. From Sunday to Thursday I tweaked my fetching script to find more lyrics and match better.</p>
<p>I&#8217;ll be iterating <a href="http://lystener.com">Lystener.com</a> from now on, and if you have ideas I&#8217;d love to hear them!</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/a-web-app-in-a-weekend-lystener-com/">A web app in a weekend: Lystener.com</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yTLBIIkL5v0:xTnZlTMZNQQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yTLBIIkL5v0:xTnZlTMZNQQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yTLBIIkL5v0:xTnZlTMZNQQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=yTLBIIkL5v0:xTnZlTMZNQQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=yTLBIIkL5v0:xTnZlTMZNQQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/yTLBIIkL5v0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/web/a-web-app-in-a-weekend-lystener-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/web/a-web-app-in-a-weekend-lystener-com/</feedburner:origLink></item>
		<item>
		<title>Fronteers Conference 2010</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/Hwo4k7BLTPo/</link>
		<comments>http://kilianvalkhof.com/2010/web/fronteers-conference-2010/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 10:12:11 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=701</guid>
		<description><![CDATA[<blockquote><p>In terms of topics, We're shooting for a more diverse range of topics than last year</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/fronteers-conference-2010/">Fronteers Conference 2010</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Like last year and the year before that, Fronteers is organising the best Front-end conference in the world. I know, because I&#8217;m helping organize it ;) Fronteers 2010 is going to be our best conference yet, with two days of the absolute top when it comes to front-end speakers. You can get <a href="http://fronteers.nl/congres/2010/tickets">early bird tickets</a> until next Wednesday, so be quick!<span id="more-701"></span></p>
<p>Fronteers 2010 will be held the 7th and 8th of October in the beautiful Tuschinski Theatre in Amsterdam. While usually a movie theatre, we&#8217;ll be using the gorgeous room with awesome soft, red cinema seats, a huge stage and an absolutely gorgeous art-deco interior as the place where, for two days straight, the best of the best of front-end will come together.</p>
<h3>Speakers</h3>
<p><a href="http://fronteers.nl/congres/2010">Fronteers 2010</a> has an impressive <a href="http://fronteers.nl/congres/2010/speakers">list of speakers</a>:</p>
<ul>
<li>Cameron Adams</li>
<li>Jina Bolton</li>
<li>Jeff Croft</li>
<li>Brendan Eich</li>
<li>Jeremy Keith</li>
<li>Nicholas Zakas</li>
</ul>
<p>And those are just the first six of our <em>fourteen</em> presentations covered! Just yesterday we also announced Brad Neuberg and Steve Faulkner + Hans Hillen, and you can expect a whole bunch of really cool names to follow in the next couple of months.</p>
<p>The conference will be hosted by my buddy <a href="http://twitter.com/juice10">Justin</a>, who did an excellent job at being the master of ceremonies, last year.</p>
<p>In terms of topics, We&#8217;re shooting for a more diverse range of topics than last year, while still keeping the technical level high. Expect topics dealing with HTML5, CSS3, JavaScript, performance, SVG and accessibility.</p>
<h3>Workshops</h3>
<p>Apart from two days of awesome presentations, this year we also host two <a href="http://fronteers.nl/congres/2010/workshops">workshop days</a> in advance of the Conference. One workshop by Andy Clarke, and one by Dan Rubin. The former will be interesting to front-end developers looking to really hone their skills and be updates to all the latest CSS3 goodness, while the latter is set up specifically for designers interested in starting with CSS, or at least getting more of a grip on it.</p>
<h3>Tickets</h3>
<p>As of writing, there are just 50 early bird tickets left, at the insane price of just &euro; 275. After next week, the price for a ticket will go up with 100 euro. So, go get some tickets and I&#8217;ll see you there!</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '28694';
var flattr_url = 'http://kilianvalkhof.com';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Kilian Valkhof';
var flattr_dsc = '';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/fronteers-conference-2010/">Fronteers Conference 2010</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Hwo4k7BLTPo:xF9Qv0D7898:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Hwo4k7BLTPo:xF9Qv0D7898:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Hwo4k7BLTPo:xF9Qv0D7898:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Hwo4k7BLTPo:xF9Qv0D7898:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Hwo4k7BLTPo:xF9Qv0D7898:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/Hwo4k7BLTPo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/web/fronteers-conference-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/web/fronteers-conference-2010/</feedburner:origLink></item>
		<item>
		<title>How to use RGBA() in IE</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/05t2o11vLDU/</link>
		<comments>http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/#comments</comments>
		<pubDate>Mon, 31 May 2010 03:00:48 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[CSS & (X)HTML]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=672</guid>
		<description><![CDATA[<blockquote><p>While it's <em>not mentioned anywhere</em> in the msdn article, the gradient filter has an #ARGB syntax.</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/">How to use RGBA() in IE</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The modern browsers all have <a href="http://kilianvalkhof.com/2007/css-xhtml/understanding-css-colour-modes/"><code>rgba()</code></a>, giving you a semi-transparent background colour while keeping the foreground elements (text, images) fully opaque. But if you want to use that in your design, what about IE? Here&#8217;s how to do it.<span id="more-672"></span></p>
<p>A while ago I made <a href="http://talenttime.nl">a design</a> with lot&#8217;s of semi transparent areas (I know, stupid me, it&#8217;s only 2010 after all) and solved that in modern browsers with <code>rgba()</code>. All fine and well, I threw in some border-radius and box-shadow, and from Opera through Firefox to Webkit, it looked increasingly better. Great, I&#8217;m all for progressive enhancement. Except it of course looked really bad in IE. I set out to find an acceptable solution.</p>
<h2>Gradients, where?</h2>
<p>For general opacity, we have <a href="http://msdn.microsoft.com/en-us/library/ms532967(v=VS.85).aspx">the alpha filter</a>. but that sets the opacity of foreground elements as well, making it useless in this case. Looking a bit further, I found the gradient filter. Seeing as how I needed transparency and not gradients, this didn&#8217;t seem very useful.</p>
<p><em>But</em> <a href="http://msdn.microsoft.com/en-us/library/ms532997(VS.85).aspx">the gradient filter</a> supports some fun stuff. While it&#8217;s <em>not mentioned anywhere</em> in the msdn article, the gradient filter has an #ARGB syntax. That&#8217;s right, the A is for Alpha. No, I don&#8217;t know why it&#8217;s at the front.</p>
<p>Anyway, Gradients don&#8217;t <em>have</em> to be between two different colours, right? You can just as easily go from white&#8230;to white. So that&#8217;s what I did:</p>
<pre><code>filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26ffffff,endColorstr=#26ffffff);</code></pre>
<p>And there you go, alpha-transparent backgrounds!</p>
<h3>Gotcha&#8217;s</h3>
<p>Of course, it&#8217;s not that easy. <code>rgba()</code> notation is in values from 0 to 255, with the <code>a</code> being a floating point between 0 and 1, and #ARGB is in hexadecimal format. You need to convert <code>rgba()</code> to #ARGB to make it useful. </p>
<p>I&#8217;ve saved you the math, here&#8217;s an easy (to and from) converter:</p>
<h3>Convert to and from rgba() and #ARGB</h3>
<style>
#converter {
-moz-border-radius:0.5em;
-webkit-border-radius:0.5em;
border-radius:0.5em;
background:#EEEEE1;
padding:1.5em;
width:auto;
}
#converter label {
width:50px;
float:left;
margin-bottom:0;
margin-top:0;
font-weight:bold;
}
#converter input {
width:25%;
float:left;
margin-top:0;
margin-right:6.5em;
margin-bottom:0;
}
</style>
<form id="converter" class="horizontalForm">
<fieldset>
  <label for="rgba">rgba()</label><br />
<input id="rgba" name="rgba" value="rgba(255,255,255,1)">
  <label for="argb">#ARGB</label><br />
<input id="argb" name="argb" value="#FFFFFFFF">
  </fieldset>
</form>
<p><script>
(function ($) {
  $(function () {
    $("#converter").submit(function(){return false;});
    $("#rgba").bind('keyup change', function () {
      var value = $(this).val();
      setArgb(value);
    });
    $("#argb").bind('keyup change', function () {
      var value = $(this).val();
      setHex(value);
    });
    setArgb = function(val) {
      var valArr = val.split("(")[1].split(")")[0].split(","),
          red = toHex(valArr[0]),
          green = toHex(valArr[1]),
          blue = toHex(valArr[2]),
          alpha = toHex(valArr[3]*255);
      $("#argb").val("#" + alpha + red + green + blue);
    };
    setHex = function(val) {
      var value = val.substring(1,9),
          red = parseInt(value.substring(2,4), 16),
          green = parseInt(value.substring(4,6), 16),
          blue = parseInt(value.substring(6,8), 16),
          alpha = Math.round((parseInt(value.substring(0,2), 16)/255)*10)/10;
      $("#rgba").val("rgba(" + red + "," + green + "," + blue + "," + alpha +")");
    };
    toHex = function(val) {
      val = parseInt(val);
      val = Math.max(0,val);
      val = Math.min(val,255);
      val = Math.round(val);
      return "0123456789ABCDEF".charAt((val-val%16)/16) + "0123456789ABCDEF".charAt(val%16);
    };
  })
}(jQuery));
</script></p>
<h3>More gotcha&#8217;s (<em>or: Oh, IE!</em>)</h3>
<p>Of course, just finding the correct value for #ARGB isn&#8217;t the <em>only</em> problem you will have. There are more downsides. For one, the code above isn&#8217;t actually the one you have to write. The code below is:</p>
<pre><code>background:none;
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26ffffff,endColorstr=#26ffffff);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26ffffff,endColorstr=#26ffffff);
zoom: 1;</code></pre>
<p>Firstly, you have to set the actual background to none, then you have to use -ms-filter for IE8, filter for everything below, and set zoom:1; to make sure the element has <code>hasLayout</code> (or else the filter doesn&#8217;t work.)</p>
<p>Apart from the code, there are two other downsides: When you use filters, <a href="http://blogs.msdn.com/b/ie/archive/2006/08/31/730887.aspx">ClearType gets disabled</a>. That&#8217;s a pretty big downside, since non-cleartyped text looks hideous. According to some you can <a href="http://cookbooks.adobe.com/post_IE8_clearType_fix_when_using_filters-16676.html">fix it</a>, but YMMV.</p>
<p>Secondly, as soon as you place the website in an iframe, say goodbye to the A in your gradient. the backgrounds will lose there transparancy and look hideous. I learned that the hard way. if you use the gradient filter, don&#8217;t display your site in an iframe. </p>
<h3>Should you use it?</h3>
<p>Using stuff like this, it&#8217;s a bit like we&#8217;re dragging IE along, kicking and screaming. And that&#8217;s what we do. We want to move forward, so we find ways to get around the limitations of lesser browsers. Whether losing ClearType is worth it depends wholly on the design. In my case it did, in your case, it might not.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/">How to use RGBA() in IE</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=05t2o11vLDU:XT1cZu7_eDY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=05t2o11vLDU:XT1cZu7_eDY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=05t2o11vLDU:XT1cZu7_eDY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=05t2o11vLDU:XT1cZu7_eDY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=05t2o11vLDU:XT1cZu7_eDY:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/05t2o11vLDU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/</feedburner:origLink></item>
		<item>
		<title>YouTube Top Ten: my new Facebook app</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/Z-s0HXzASFM/</link>
		<comments>http://kilianvalkhof.com/2010/web/youtube-top-ten-my-new-facebook-app/#comments</comments>
		<pubDate>Wed, 12 May 2010 11:28:00 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=658</guid>
		<description><![CDATA[<blockquote><p>&#8230;a project to see how fast we could bring something "to market" and whether we can make a Facebook app work.</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/youtube-top-ten-my-new-facebook-app/">YouTube Top Ten: my new Facebook app</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A little over a week ago we set out to build <a href="http://www.youtubetopten.com">YouTubeTopTen</a>: A Facebook application where you can vote for your favorite video&#8217;s, get your friends to vote for them too and at the end of the week, we generate a top ten and update you if your video got in the top ten. <span id="more-658"></span></p>
<p><img src="http://www.youtubetopten.com/media/images/logo.png" alt="" style="margin-left:auto;margin-right:auto;display:block" /></p>
<p>&#8216;We&#8217; in this case is my team at <a href="http://fluxility.com" lang="nl">Fluxility</a>. Most of the time we make websites and webapps for clients, but we&#8217;re focusing more and more on building our own sites. This was at once a fun diversion, a project to see how fast we could bring something &#8220;to market&#8221; and whether we can make a Facebook app work. We&#8217;re still out on the last one, but the first two have been a major success in our book. :)</p>
<h2>Facebook integration</h2>
<p>The worst thing Facebook could do was change their API right before we started. Which of course <em><a href="http://graph.facebook.com/">they did</a></em>. This meant we couldn&#8217;t use the current Django facebook apps available, and had to write our own. </p>
<p>With focusing on getting the website online, that app needs to be cleaned up a bit first but then we&#8217;ll open source it over at <a href="http://github.com">Github</a> so everyone can use it. Facebook&#8217;s documentation and application settings are pretty bad. Every thing&#8217;s there, sure, but it&#8217;s very <em>opaque</em> and hard to find. We got there, but it took far more work than necessary.</p>
<h2>Front-end stuff</h2>
<p>As the website is basically one page, there is a lot of JavaScript and AJAX stuff going on (yay!), including getting the YouTube videos. For that we use <a href="http://oembed.com">oEmbed</a>. We started out with the <a href="http://code.google.com/p/jquery-oembed/">jquery-oembed</a> plugin. Unfortunately during testing the webservice behind that plugin (<a href="http://oohembed.org">oohembed.org</a>) was offline a lot. It&#8217;s hosted for free at Google AppEngine, so it&#8217;s understandable, but we need something a bit more reliable.</p>
<p>Enter <a href="http://embed.ly">Embed.ly</a>. I replaced the jquery-oembed libary with 6 lines of youtube-specific code, wrapped it in a jQuery plugin and it worked. Awesome! One thing I hope Embed.ly will do is add a <code>wmode=transparant</code> to YouTube videos to make it easier for us to do stuff with it. I could add it in with JavaScript myself, but I&#8217;d rather not. </p>
<h2>Up next</h2>
<p>Everything is working pretty well right now, but of course we have plans to expand. We offer a homepage position for videos for 300 euros a week (discounted from 500 for this month only). People can vote for this video too, so if your video is awesome enough, it&#8217;ll enjoy another week in the top ten.</p>
<p>As for the site itself, we want to get to daily top tens as soon as possible, but this means we need traction first (<em>so get <a href="http://youtubetopten.com">on there!</a></em>). I&#8217;m also developing a Bookmarklet so you can vote directly from YouTube and we&#8217;re going to add a page with all submitted videos for you to peruse.</p>
<p>Let me know what you think and of course <a href="http://www.facebook.com/apps/application.php?id=116997341654738">Become a fan</a> and <strong><a href="http://www.youtubetopten.com">Start using Youtubetopten.com!</a></strong></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '28694';
var flattr_url = 'http://kilianvalkhof.com';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Kilian Valkhof';
var flattr_dsc = '';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/youtube-top-ten-my-new-facebook-app/">YouTube Top Ten: my new Facebook app</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Z-s0HXzASFM:QgXW8P0B9dc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Z-s0HXzASFM:QgXW8P0B9dc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Z-s0HXzASFM:QgXW8P0B9dc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Z-s0HXzASFM:QgXW8P0B9dc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Z-s0HXzASFM:QgXW8P0B9dc:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/Z-s0HXzASFM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/web/youtube-top-ten-my-new-facebook-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/web/youtube-top-ten-my-new-facebook-app/</feedburner:origLink></item>
		<item>
		<title>CSS Vendor prefixes considered important</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/DGXPE9KaQBw/</link>
		<comments>http://kilianvalkhof.com/2010/css-xhtml/css-vendor-prefixes-considered-important/#comments</comments>
		<pubDate>Wed, 05 May 2010 13:26:07 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[CSS & (X)HTML]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=633</guid>
		<description><![CDATA[<blockquote><p>Sure, typing -moz-, -webkit, -o- again and again gets annoying, but come on, <em>you're a developer</em></p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/css-vendor-prefixes-considered-important/">CSS Vendor prefixes considered important</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Lately, there has been a lot of hate towards vendor prefixes. First, PPK <a href="http://www.quirksmode.org/blog/archives/2010/03/css_vendor_pref.html">wrote about them</a>, and then a <a href="http://ajaxian.com/archives/should-css-vendor-prefixes-be-nuked-or-just-tweaked">some</a> <a href="http://www.vcarrer.com/2010/05/css-vendor-prefixes-can-we-all-get.html">other</a> people did. The proposed solution to the &#8216;problem&#8217; of vendor prefixes is to get rid of them in favor of one <code>-beta-</code> prefix. Simply put: That won&#8217;t work.<span id="more-633"></span></p>
<h3>Why they exist</h3>
<p>You see, vendor prefixes exist for one important reason. Vendor prefixes are used for <strong>unfinished specifications</strong>. Unfinished specifications change. They evolve. Sometimes they don&#8217;t describe the implementation at all, or the syntax has yet to be agreed upon. They are not done yet. <strong>They are <em>unfinished</em></strong>. </p>
<p>This means browsers could, and will implement things differently. To give a concrete example: Gecko and Webkit implemented the <code>border-radius</code> syntax differently. Had there been only one &#8220;<code>-beta-</code>&#8221; prefix, you could not have used border-radius in a cross browser way. That doesn&#8217;t seem like a real solution, does it? </p>
<h3><i class="lquo">&#8220;</i>But I have to type so much!<i class="rquo">&#8221;</i></h3>
<p>Sure, typing -moz-, -webkit, -o- again and again gets annoying, but come on, <em>you&#8217;re a developer</em>. It&#8217;s trivial to make a snippet (or whatever your editor calls them) for this, or to use a <a href="http://sass-lang.com/">Sass</a> or <a href="http://lesscss.org/">LESS</a> mixin. <strong><a href="http://gist.github.com/144406">Tools will save us</a></strong>. </p>
<h3>Vendor prefixes are awesome</h3>
<p>Vendor prefixes allow us to test out new technologies, they allow different browsers to implement them in the way they seem most conforming to the specification (at that moment). This in turn allows developers to deal with browser differences by setting different values for each vendor prefix. </p>
<p>Browsers get to test out different implementations, and developers get early access to new possibilities. That seems like an excellent deal to me.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/css-vendor-prefixes-considered-important/">CSS Vendor prefixes considered important</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=DGXPE9KaQBw:dnIX7NgPCSQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=DGXPE9KaQBw:dnIX7NgPCSQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=DGXPE9KaQBw:dnIX7NgPCSQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=DGXPE9KaQBw:dnIX7NgPCSQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=DGXPE9KaQBw:dnIX7NgPCSQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/DGXPE9KaQBw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/css-xhtml/css-vendor-prefixes-considered-important/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/css-xhtml/css-vendor-prefixes-considered-important/</feedburner:origLink></item>
		<item>
		<title>How to build a fast, simple list filter with jQuery</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/kLYyojWP47c/</link>
		<comments>http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 08:00:03 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=613</guid>
		<description><![CDATA[<blockquote><p>jQuery has a way to check for matched elements easily: the <code>:contains()</code> selector.</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/">How to build a fast, simple list filter with jQuery</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want users of your web-app to quickly filter a list down. For example, a web-app I&#8217;m currently working on features a page listing two dozen countries, and I want users to find the country they are looking for as fast as possible. This article shows you how little code is needed to add this in a fast, progressively-enhanced way using jQuery.<span id="more-613"></span></p>
<h3>Demo</h3>
<p>If you&#8217;re the impatient type, I&#8217;ve set up a simple demo: <a href="http://kilianvalkhof.com/uploads/listfilter/">A simple list filter with jQuery</a>.</p>
<h3>The HTML</h3>
<p>The basic HTML you need for this is simple: just a header and a simple unordered list. They both have id&#8217;s so we can easily and uniquely find them:</p>
<pre><code>&lt;h1 id="header"&gt;List of countries&lt;/h1&gt;

&lt;ul id="list"&gt;
  &lt;li&gt;&lt;a href="/australia"&gt;Australia&lt;/a&gt;&#038;lt/li&gt;
  &lt;li&gt;&lt;a href="/austria"&gt;Austria&lt;/a&gt;&#038;lt/li&gt;
  &lt;li&gt;&lt;a href="/belgium"&gt;Belgium&lt;/a&gt;&#038;lt/li&gt;
  &hellip;
&lt;ul&gt;</code></pre>
<p>With the HTML ready, here is what the filter function needs to do:</p>
<ol>
<li>Add an input to the header</li>
<li>Set up events to check when someone is typing in the input</li>
<li>Check the value of the input, and compare it to the countries in the list</li>
<li>Hide the non-matching ones, while showing the matching ones</li>
</ol>
<h3>Step 1: add an input to the header</h3>
<p>We&#8217;ll start with a simple function, we&#8217;ll call it listFilter:</p>
<pre><code>function listFilter(header, list) {
  &hellip;
}</code></pre>
<p>As you see, the function takes two arguments. We&#8217;ll use jQuery to select the aforementioned header and list and give them as arguments to our function. Next, we need to create a form with an input in it, and append it to the header:</p>
<pre><code>function listFilter(header, list) {
  // create and add the filter form to the header
  var form = $("&lt;form&gt;").attr({"class":"filterform","action":"#"}),
      input = $("&lt;input&gt;").attr({"class":"filterinput","type":"text"});

  $(form).append(input).appendTo(header);
  &hellip;
}</code></pre>
<p>Using $(&#8220;&lt;form&gt;&#8221;) (with brackets) we can create new elements, and by inserting the input into the form using <code>append()</code>, and then using the <code>appendTo()</code> function to add the form (with the input in it) to the header, we easily add it into the page. For easy of use I&#8217;ve given both the form and the input classes, so you can style them easily.</p>
<p>That&#8217;s step one done, but it doesn&#8217;t do anything yet, for that we need to&hellip;</p>
<h3>Step 2: set up events</h2>
<p>To check for text in the input, we can use the <code>change</code> event. This fires every time the value of the input has changed, but only when you exit the input. However, this doesn&#8217;t work with a letter-for-letter filter. For that, we need to watch the <code>keyup</code> event a well. We use <code>keyup</code> instead of <code>keydown</code> because it fires after you pressed the key, and so the value of the input then includes the just-typed letter. With <code>keydown</code>, the event gets fired before the letter is added, so JavaScript can&#8217;t pick it up in the value of the input.</p>
<p>While using two events, there is no need to do double work. When we receive a <code>keyup</code> event, we just fire a <code>change</code> event:</p>
<pre><code>function listFilter(header, list) {
  &hellip;
  $(input).change( function () {
    &hellip;
  }).keyup( function () {
    // fire the above change event after every letter
    $(this).change();
  });
  &hellip;
}</code></pre>
<p>We&#8217;re now all set to start with the actual checking!</p>
<h3>Step 3: compare the values</h3>
<p>jQuery has a way to check for matched elements easily: the <code><a href="http://api.jquery.com/contains-selector/">:contains()</a></code> selector. Using this, you can very easily select all element containing the text between the parenthesis:</p>
<pre><code>function listFilter(header, list) {
  &hellip;
  $(input).change( function () {
    var filter = $(this).val(); // get the value of the input, which we filter on
    $(list).find("a:contains(" + filter + ")").parent().slideDown();
  });
  &hellip;
}</code></pre>
<p>The code above works like this: in the list, which is the <code>&lt;ul&gt;</code> element. it finds all the shows all the <code>&lt;a&gt;</code> elements that contain the value in the input. It then selects the parents of those <code>&lt;a&gt;</code> elements, the <code>&lt;li&gt;</code>&#8216;s. Those li&#8217;s then get shown. However, since we filter the list, we need to also hide all the li&#8217;s that <em>do not contain</em> that value. For this, jQuery offers the <code>:not()</code> selector, and we can just wrap that around the <code>:contains()</code> selector, like so:</p>
<pre><code>function listFilter(header, list) {
  &hellip;
  $(input).change( function () {
    var filter = $(this).val(); // get the value of the input, which we filter on
    $(list).find("a:not(:contains(" + filter + "))").parent().slideUp();
    $(list).find("a:contains(" + filter + ")").parent().slideDown();
  });
  &hellip;
}</code></pre>
<p>There, now with each keystroke, we check the list for matching elements, and hide the ones that don&#8217;t match. Easy-peasy.</p>
<p>But wait. What happens when you clear the input? Then $(this).val(); will be empty, and nothing matches with empty. So all list items will be hidden, the exact opposite of what we want. This can be remedied by just checking if $(this).val(); has any value, and if not, just showing everything:</p>
<pre><code>function listFilter(header, list) {
  &hellip;
  $(input).change( function () {
    var filter = $(this).val();
    if (filter) {
      $(list).find("a:not(:contains(" + filter + "))").parent().slideUp();
      $(list).find("a:contains(" + filter + ")").parent().slideDown();
    } else {
      $(list).find("li").slideDown();
    }
  });
  &hellip;
}</code></pre>
<p>Typing in letters now filters down the list, and removing them all shows the entire, now unfiltered, list again. Is that all we need? Well, It would be, except that <code>:contains()</code> is <em>case-sensitive</em>. so if you filter with &#8220;austria&#8221;, you won&#8217;t find Austria!</p>
<h3>Building a case-insensitive :contains()</h3>
<p>jQuery allows you to add your own selector expressions, and we can use that to build our own contains filter that&#8217;s a bit more sensible:</p>
<pre></code>jQuery.expr[':'].Contains = function(a,i,m){
    return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
};</code></pre>
<p>This adds a <code>:Contains()</code> (<em>note the uppercase</em>) option to your selectors that does the same as <code>:contains()</code>, but it first converts all text to uppercase, and then compares them. So once we add this to your JavaScript, all we have to do in our listFilter function is replace <code>:contains()</code> with <code>Contains()</code> and we have a fast, simple, progressively-enhanced way to filter down a large list!</p>
<h3>Demo</h3>
<p>If you want to browse through the entire, documented code, and see it in action, check out the example page: <a href="http://kilianvalkhof.com/uploads/listfilter/">A simple list filter with jQuery</a>.</p>
<p>Please let me know in the comments what you would use this for, and please let me know your remarks and questions!</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '28694';
var flattr_url = 'http://kilianvalkhof.com';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Kilian Valkhof';
var flattr_dsc = '';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/">How to build a fast, simple list filter with jQuery</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=kLYyojWP47c:CqoyOehkou8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=kLYyojWP47c:CqoyOehkou8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=kLYyojWP47c:CqoyOehkou8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=kLYyojWP47c:CqoyOehkou8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=kLYyojWP47c:CqoyOehkou8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/kLYyojWP47c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/</feedburner:origLink></item>
		<item>
		<title>Trimage image compressor</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/Yurs0dE2pME/</link>
		<comments>http://kilianvalkhof.com/2010/web/trimage-image-compressor/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 10:26:06 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=605</guid>
		<description><![CDATA[<blockquote><p> I wanted an easier way to compress my files that didn't involve mucking about on the command line or uploading all my images to some server far away via a crappy flash application.</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/trimage-image-compressor/">Trimage image compressor</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As a front-end developer, minimizing your images is important. Compressed images load faster and take less time to download. However, most current tools that can do that are command line applications that only support one type of image, and oftentimes do not have the same API. To scratch my own itch I build a cross-platform GUI image compressor.<span id="more-605"></span></p>
<h2>Trimage</h2>
<p>Trimage is a GUI front-end to a couple of command line tools available on most linux based systems (though it should work on mac and windows, too), and can <em>losslessy</em> compress both PNG and JPG files. It looks native, (dare I say) pretty and is very easy to use.</p>
<p>That&#8217;s why Trimage has multiple ways of accepting files: You can drop them onto the app, you can open them via a file dialog, and you can feed it images or entire directories via the command line. So you can pick the method you find most comfortable, and use that.</p>
<p>More information can be found on the website: <strong><a href="http://trimage.org">Trimage.org</a></strong>.</p>
<p><img src="http://trimage.org/image.png" alt="screenshot of trimage"></p>
<h2>How to install</h2>
<p>For the moment, I only have installation guides for Ubuntu and other linux-based systems. If you can help me with Mac and Windows, please e-mail me at <a href="mailto:help@trimage.org">help@trimage.org</a>!</p>
<h3>Ubuntu</h3>
<p>Ubuntu is by far the easiest to install. If you&#8217;re on karmic or lucid, simply enter this into your console:</p>
<ol>
<li><code>sudo add-apt-repository ppa:kilian/trimage</code></li>
<li><code>sudo apt-get update</code></li>
<li><code>sudo apt-get install trimage</code></li>
</ol>
<p>If you are still on Jaunty, read <a href="https://launchpad.net/+help/soyuz/ppa-sources-list.html">this guide</a> on installing PPA&#8217;s.</p>
<h3>Other Linux:</h3>
<p>I&#8217;m still looking for help with making .debs, .rpms and the like, but you can install Trimage via python as well:</p>
<ol>
<li>Download the source via <a href="http://github.com/Kilian/Trimage">GitHub</a> or <a href="https://launchpad.net/trimage">Launchpad</a></li>
<li>Make sure you have all the requirements installed: python <em>2.6</em>, python-qt4 <em>4.4</em>, optipng <em>0.6.2.1</em>, advancecomp <em>1.15</em>, jpegoptim <em>1.2.2</em>, or higher versions</li>
<li>Enter <code>python setup.py install</code> into your console</li>
<li>Launch by executing <code>trimage</code></li>
</ol>
<h2>Why and how</h2>
<p>As I said in the intro, I wrote this mostly to scratch my own itch. I wanted an easier way to compress my files that didn&#8217;t involve mucking about on the command line or uploading all my images to some server far away via a crappy flash application.</p>
<p>Trimage was <a href="http://news.ycombinator.com/item?id=1032135">inspired by</a> <a href="http://imageoptim.pornel.net">ImageOptim</a>. It is made using python and the PyQt GUI framework. The choice for PyQt was made for a couple of reasons: the Qt4 designer is very easy to use, it&#8217;s available cross-platform and most importantly, it provides native widgets. As the latter is my number one annoyance, and I actively avoid using programs that do not look like they belong in my gnome desktop, this was a big issue for me. <a href="http://paulchaplin.com">Paul Chaplin</a> helped me with a lot of the python stuff.</p>
<p>However, PyQt has some downsides as well. For one. The <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html">documentation</a> is bad. It&#8217;s not complete, hard to read and sometimes isn&#8217;t even correct. That&#8217;s not to say it&#8217;s unusable, but it clearly needs some more love.</p>
<p>Where the documentation lacks however, the #pyqt IRC channel on freenode is <em>awesome</em>. There are a bunch of really smart and nice people there that go out of their way to help you. Every community should be like this.</p>
<p>If you want to build a GUI app for Ubuntu using python, the best start you can get is <a href="https://code.launchpad.net/~rowinggolfer/pyapptemplate/main">PyAppTemplate</a> by Neil Wallace, which takes care of all the Hoohaa and voodoo that goes into a setup.py and the debian build files. It took me a day to try and figure it all out by myself, and then an hour to get it working using PyAppTemplate.</p>
<h3>Future development</h3>
<p>As you can see on the <a href="http://trimage.org">website</a>, I have a bunch of features lined up for the coming versions. All development is done on <a href="http://github.com/Kilian/Trimage">GitHub</a>, so if you want to help out, add more options or scratch an item from the todo, I appreciate all help!</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/web/trimage-image-compressor/">Trimage image compressor</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Yurs0dE2pME:KYOuQjWQBiw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Yurs0dE2pME:KYOuQjWQBiw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Yurs0dE2pME:KYOuQjWQBiw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=Yurs0dE2pME:KYOuQjWQBiw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=Yurs0dE2pME:KYOuQjWQBiw:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/Yurs0dE2pME" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/web/trimage-image-compressor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/web/trimage-image-compressor/</feedburner:origLink></item>
		<item>
		<title>CSS3 loading spinners without images</title>
		<link>http://feedproxy.google.com/~r/Kilianvalkhofcom/~3/lWrwUq74fsY/</link>
		<comments>http://kilianvalkhof.com/2010/css-xhtml/css3-loading-spinners-without-images/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:00:53 +0000</pubDate>
		<dc:creator>Kilian Valkhof</dc:creator>
				<category><![CDATA[CSS & (X)HTML]]></category>

		<guid isPermaLink="false">http://kilianvalkhof.com/?p=575</guid>
		<description><![CDATA[<blockquote><p>After playing around with chaining different transforms, I found out something interesting&#8230;</p></blockquote><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/css3-loading-spinners-without-images/">CSS3 loading spinners without images</a></p>
]]></description>
			<content:encoded><![CDATA[<p>While playing around with css-transform to make various shapes, I saw a way to create animated image-less loading spinners such as used in a lot of webapps and of course on the iPhone.<span id="more-575"></span></p>
<h3>CSS transforms</h3>
<p>CSS transform (in Firefox 3.5+ and Webkit-based browsers) has a whole bunch of interesting functions, such as rotation, translation, scaling and skewing. To learn more about the different functions, check out the Mozilla developer center overview of <a href="https://developer.mozilla.org/en/CSS/-moz-transform">CSS transform</a>. After playing around with chaining different transforms and seeing the effect, I found out something interesting:</p>
<div style="width:100px;height:100px;border:1px solid #eee;position:relative;margin-bottom:1.5em">
<div style="position:absolute;height:50px;width:20px;top:25px;left:40px;background:#ddd;"></div>
<div style="position:absolute;height:50px;width:20px;top:25px;left:40px;background:#000;-moz-transform:rotate(45deg) translate(0, -35px);-webkit-transform:rotate(45deg) translate(0, -35px)"></div>
</div>
<pre><code>transform:rotate(45deg) translate(0, -35px);</code></pre>
<p>If you rotate first, and then translate (move), it will move <em>along the rotated axis</em>. The above code translates a block to the top-right corner (45 degrees). (the gray div is not transformed while the black one is.)</p>
<p>Using this, I could rotate and translate a bunch of divs to create loading spinners (though this one doesn&#8217;t spin yet!):</p>
<div id="div1">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<div class="bar4"></div>
<div class="bar5"></div>
<div class="bar6"></div>
<div class="bar7"></div>
<div class="bar8"></div>
</div>
<p>In this example, each div is rotated an additional 45 degrees. The first one is not rotated, the second one is rotated 45 degrees, the one after that 90 degrees, and so forth. Additionally, each div has increased opacity to make it look like most loading spinners.</p>
<h3>Animation</h3>
<p>Webkit supports CSS animations, but these are continuous while most loading spinners are not. On the left side is a spinner animated with CSS animation (only works in Safari and Chrome), on the right there&#8217;s one animated with a small bit of JavaScript to look like regular loading spinners:</p>
<div id="div2">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<div class="bar4"></div>
<div class="bar5"></div>
<div class="bar6"></div>
<div class="bar7"></div>
<div class="bar8"></div>
</div>
<div id="div3">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<div class="bar4"></div>
<div class="bar5"></div>
<div class="bar6"></div>
<div class="bar7"></div>
<div class="bar8"></div>
</div>
<p style="clear:both">The code for the CSS animation is fairly straightforward:</p>
<pre><code>#div2 {
  -webkit-animation-name: rotateThis;
  -webkit-animation-duration:2s;
  -webkit-animation-iteration-count:infinite;
  -webkit-animation-timing-function:linear;
}
@-webkit-keyframes rotateThis {
  from {-webkit-transform:scale(0.5) rotate(0deg);}
  to {-webkit-transform:scale(0.5) rotate(360deg);}
} </code></pre>
<p>While the (quick and dirty) code for the JavaScript animation is pretty easy as well:</p>
<pre><code>  var count = 0;
  function rotate() {
    var elem2 = document.getElementById('div3');
    elem2.style.MozTransform = 'scale(0.5) rotate('+count+'deg)';
    elem2.style.WebkitTransform = 'scale(0.5) rotate('+count+'deg)';
    if (count==360) { count = 0 }
    count+=45;
    window.setTimeout(rotate, 100);
  }
  window.setTimeout(rotate, 100);</code></pre>
<p>Someone else might be able to duplicate the loading spinner-style rotation with CSS animations (please let me know!), but the JavaScript solution looks better and works in Firefox too.</p>
<h3>Going crazy with it (More examples!)</h2>
<p>Once I had the basic &#8216;functionality&#8217; working, I just decided to go crazy with it and create a whole bunch of different style loading spinners. You can find them on this page: <strong><a href="/uploads/spinners/">CSS3 loading spinner examples</a></strong>. </p>
<p>Check out the source for the way to style the different spinners and let me know when you make interesting variations!</p>
<style>
/* position the bars and balls correctly (rotate them and translate them outward)*/
.bar1 {
  -moz-transform:rotate(0deg) translate(0, -40px);
  -webkit-transform:rotate(0deg) translate(0, -40px);opacity:0.12;
}
.bar2 {
  -moz-transform:rotate(45deg) translate(0, -40px);
  -webkit-transform:rotate(45deg) translate(0, -40px);opacity:0.25;
}
.bar3 {
  -moz-transform:rotate(90deg) translate(0, -40px);
  -webkit-transform:rotate(90deg) translate(0, -40px);opacity:0.37;
}
.bar4 {
  -moz-transform:rotate(135deg) translate(0, -40px);
  -webkit-transform:rotate(135deg) translate(0, -40px);opacity:0.50;
}
.bar5 {
  -moz-transform:rotate(180deg) translate(0, -40px);
  -webkit-transform:rotate(180deg) translate(0, -40px);opacity:0.62;
}
.bar6 {
  -moz-transform:rotate(225deg) translate(0, -40px);
  -webkit-transform:rotate(225deg) translate(0, -40px);opacity:0.75;
}
.bar7 {
  -moz-transform:rotate(270deg) translate(0, -40px);
  -webkit-transform:rotate(270deg) translate(0, -40px);opacity:0.87;
}
.bar8 {
  -moz-transform:rotate(315deg) translate(0, -40px);
  -webkit-transform:rotate(315deg) translate(0, -40px);opacity:1;
}
#div1, #div2, #div3 {
  position:relative;
  width:100px;
  height:100px;
  margin-bottom:1.5em;
  margin-right:1.5em;
  -moz-border-radius:100px;
  float:left;
  -moz-transform:scale(0.5);
  -webkit-transform:scale(0.5);
}
#div1 {float:none}
#div1 div,
#div2 div,
#div3 div {
  width:10px;
  height:30px;
  background:#000;
  position:absolute;
  top:35px;
  left:45px;
}
#div2 {
  -webkit-animation-name: rotateThis;
  -webkit-animation-duration:2s;
  -webkit-animation-iteration-count:infinite;
  -webkit-animation-timing-function:linear;
}
@-webkit-keyframes rotateThis {
  from {-webkit-transform:scale(0.5) rotate(0deg);}
  to {-webkit-transform:scale(0.5) rotate(360deg);}
} 
</style>
<p><script>
  var count = 0;
  function rotate() {
    var elem2 = document.getElementById('div3');
    elem2.style.MozTransform = 'scale(0.5) rotate('+count+'deg)';
    elem2.style.WebkitTransform = 'scale(0.5) rotate('+count+'deg)';
    if (count==360) { count = 0 }
    count+=45;
    window.setTimeout(rotate, 100);
  }
  window.setTimeout(rotate, 100);
</script></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '28694';
var flattr_url = 'http://kilianvalkhof.com';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Kilian Valkhof';
var flattr_dsc = '';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://kilianvalkhof.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><p>This article is written by Kilian Valkhof, Front-end developer & User experience designer. Please visit <a href="http://kilianvalkhof.com">KilianValkhof.com</a> for more articles!<br/><br/><a href="http://kilianvalkhof.com/2010/css-xhtml/css3-loading-spinners-without-images/">CSS3 loading spinners without images</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=lWrwUq74fsY:Ny82DFRkGOQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=lWrwUq74fsY:Ny82DFRkGOQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=lWrwUq74fsY:Ny82DFRkGOQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?a=lWrwUq74fsY:Ny82DFRkGOQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/Kilianvalkhofcom?i=lWrwUq74fsY:Ny82DFRkGOQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Kilianvalkhofcom/~4/lWrwUq74fsY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kilianvalkhof.com/2010/css-xhtml/css3-loading-spinners-without-images/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		<feedburner:origLink>http://kilianvalkhof.com/2010/css-xhtml/css3-loading-spinners-without-images/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.893 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-08 16:39:47 -->
