<?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>Hay Kranen &#187; english</title>
	<atom:link href="http://www.haykranen.nl/category/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haykranen.nl</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 15:02:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Objective best practices for WordPress plugin development</title>
		<link>http://www.haykranen.nl/2010/09/01/objective-best-practices-for-wordpress-plugin-development/</link>
		<comments>http://www.haykranen.nl/2010/09/01/objective-best-practices-for-wordpress-plugin-development/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 15:02:49 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1426</guid>
		<description><![CDATA[Objective best practices for WordPress plugin development Must-read thread for any WP plugin coders. I&#8217;ve written two suggestions, about using a template mechanism and about using classes and proper PHP5 OO-code.]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.stackexchange.com/questions/715/objective-best-practices-for-plugin-development/">Objective best practices for WordPress plugin development</a></p>
<p>Must-read thread for any WP plugin coders. I&#8217;ve written two suggestions, about <a href="http://wordpress.stackexchange.com/questions/715/objective-best-practices-for-plugin-development/1187#1187">using a template mechanism</a> and about <a href="http://wordpress.stackexchange.com/questions/715/objective-best-practices-for-plugin-development/1189#1189">using classes and proper PHP5 OO-code</a>.</p>
<img class="colorbox-1426"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1426&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/09/01/objective-best-practices-for-wordpress-plugin-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iReader plugin mimics Safari&#8217;s &#8216;Reader&#8217; option almost to perfection</title>
		<link>http://www.haykranen.nl/2010/08/19/ireader-plugin-mimics-safaris-reader-option/</link>
		<comments>http://www.haykranen.nl/2010/08/19/ireader-plugin-mimics-safaris-reader-option/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 21:19:28 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1378</guid>
		<description><![CDATA[Thanks to a Superuser question i asked a few weeks ago i discovered the wonderful iReader plugin for Google Chrome. It mimics Safari 5.0&#8242;s new Reader functionality almost to perfection (hopefully Apple won&#8217;t be pointing their copyright lawyers to this blogpost right now). The &#8216;Reader&#8217; option in Safari gives you an uncluttered view of an article [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1381 colorbox-1378" title="ireader" src="http://www.haykranen.nl/wp-content/uploads/2010/08/ireader.jpg" alt="" width="400" height="250" /></p>
<p>Thanks to a <a href="http://superuser.com/questions/158222/chrome-firefox-extension-like-safari-5s-reader-feature/177844#177844">Superuser question</a> i asked a few weeks ago i discovered the wonderful <a href="http://www.samabox.com/blog/category/extensions/ireader/">iReader plugin</a> for Google Chrome. It mimics Safari 5.0&#8242;s new <a href="http://www.samabox.com/blog/category/extensions/ireader/">Reader functionality</a> almost to perfection (hopefully Apple won&#8217;t be pointing their copyright lawyers to this blogpost right now). The &#8216;Reader&#8217; option in Safari gives you an uncluttered view of an article on a website without ads and nice fonts, a bit like <a href="http://lab.arc90.com/experiments/readability/">Readability</a> or <a href="http://www.instapaper.com/">Instapaper</a> but with multi-page support.</p>
<p>It doesn&#8217;t quite render multi-page articles perfectly, such as the infamous <a href="http://www.wired.com/magazine/2010/08/ff_webrip/">Wired article</a> on the death of the web. But Safari&#8217;s Reader doesn&#8217;t render that correctly too.</p>
<p>There&#8217;a also a <a href="https://addons.mozilla.org/en-US/firefox/addon/195787/">beta version</a> available for Firefox.</p>
<img class="colorbox-1378"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1378&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/08/19/ireader-plugin-mimics-safaris-reader-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.haykranen.nl/2010/08/15/1353/</link>
		<comments>http://www.haykranen.nl/2010/08/15/1353/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 11:24:23 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1353</guid>
		<description><![CDATA[jQuery Mobile &#124; jQuery Mobile New version of jQuery targeted for mobile touch devices. Release date is somewhere end of this year.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquerymobile.com/">jQuery Mobile | jQuery Mobile</a></p>
<p>New version of jQuery targeted for mobile touch devices. Release date is somewhere end of this year.</p>
<img class="colorbox-1353"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1353&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/08/15/1353/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript and sorting</title>
		<link>http://www.haykranen.nl/2010/08/12/javascript-and-sorting/</link>
		<comments>http://www.haykranen.nl/2010/08/12/javascript-and-sorting/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 08:11:27 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>
		<category><![CDATA[tutorial / howto]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1348</guid>
		<description><![CDATA[Sorting in Javascript using the Array.sort() function doesn&#8217;t work how i thought it did: var foo = [3, 4, 5, 2, 1]; foo.sort(function(a,b) { return a < b; }); console.log(foo); In Firefox this gives the result you expect ([1,2,3,4,5]), but in Chrome and Safari, it doesn't (and in IE too probably). When re-reading the spec [...]]]></description>
			<content:encoded><![CDATA[<p>Sorting in Javascript using the <tt>Array.sort()</tt> function doesn&#8217;t work how i thought it did:</p>
<pre>
var foo = [3, 4, 5, 2, 1];
foo.sort(function(a,b) {
    return a < b;
});
console.log(foo);
</pre>
<p>In Firefox this gives the result you expect (<tt>[1,2,3,4,5]</tt>), but in Chrome and Safari, it doesn't (and in IE too probably). When <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort">re-reading the spec at Mozilla's dev site</a> i discovered why:</p>
<blockquote style="font-size:10px;"><p>
If compareFunction(a, b) is less than 0, sort a to a lower index than b. (…) If compareFunction(a, b) is greater than 0, sort b to a lower index than a.</p></blockquote>
<p>So, the return value should not be <tt>true</tt> or <tt>false</tt> but -1 or 1. The example above should be written as:</p>
<pre>
foo.sort(function(a,b) {
    return a - b;
});
</pre>
<img class="colorbox-1348"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1348&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/08/12/javascript-and-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.haykranen.nl/2010/07/22/html5-fullscreen/</link>
		<comments>http://www.haykranen.nl/2010/07/22/html5-fullscreen/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 16:21:44 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1330</guid>
		<description><![CDATA[Mozilla proposes a fullscreen API for HTML5 sites Wondering how they&#8217;re gonna pull this off security-wise.]]></description>
			<content:encoded><![CDATA[<p><a href="https://wiki.mozilla.org/Gecko:FullScreenAPI">Mozilla proposes a fullscreen API for HTML5 sites</a></p>
<p>Wondering how they&#8217;re gonna pull this off security-wise.</p>
<img class="colorbox-1330"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1330&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/07/22/html5-fullscreen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO completely disable the auto-translate feature in Google Chrome</title>
		<link>http://www.haykranen.nl/2010/07/17/howto-completely-disable-the-auto-translate-feature-in-google-chrome/</link>
		<comments>http://www.haykranen.nl/2010/07/17/howto-completely-disable-the-auto-translate-feature-in-google-chrome/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 11:13:58 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[tutorial / howto]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1321</guid>
		<description><![CDATA[Preferences (either from the menu or from the wrench) &#8211;&#62; Under the hood &#8211;&#62; Scroll down to &#8216;Web content&#8217; and uncheck &#8216;Offer to translate pages that aren&#8217;t in a language i read&#8217;. I didn&#8217;t know this option existed. However, i still think Chrome should have an option in the dropdown menu in the translation bar [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.haykranen.nl/wp-content/uploads/2010/07/chrome.jpg"><img class="alignnone size-medium wp-image-1322 colorbox-1321" title="chrome" src="http://www.haykranen.nl/wp-content/uploads/2010/07/chrome-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>Preferences (either from the menu or from the wrench) &#8211;&gt; Under the hood &#8211;&gt; Scroll down to &#8216;Web content&#8217; and uncheck &#8216;Offer to translate pages that aren&#8217;t in a language i read&#8217;.</p>
<p>I didn&#8217;t know this option existed. However, i still think Chrome should have an option in the dropdown menu in the translation bar itself, <a href="http://code.google.com/p/chromium/issues/detail?id=48776">for which i&#8217;ve opened a ticket</a>.</p>
<img class="colorbox-1321"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1321&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/07/17/howto-completely-disable-the-auto-translate-feature-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jsDynaLoad: Dynamic Javascript loader with multi-file support</title>
		<link>http://www.haykranen.nl/2010/07/05/dynamic-javascript-loader-with-multi-file-support/</link>
		<comments>http://www.haykranen.nl/2010/07/05/dynamic-javascript-loader-with-multi-file-support/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 22:40:08 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>
		<category><![CDATA[tutorial / howto]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1290</guid>
		<description><![CDATA[I wrote a (very) small Javascript function to dynamically load Javascript files. In modern Javascript development you usually have more than one Javascript file in your page (e.g. jQuery, a few plugins, a main javascript file) that depend on each other. Loading them using the &#60;script&#62; tag works, but sometimes you get a dependency problem [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a (very) small Javascript function to dynamically load Javascript files. In modern Javascript development you usually have more than one Javascript file in your page (e.g. jQuery, a few plugins, a main javascript file) that depend on each other. Loading them using the <tt>&lt;script&gt;</tt> tag works, but sometimes you get a dependency problem because scripts are not guaranteed to load from top to bottom in the order they appear in on the page.</p>
<p>The script is based on <a href="http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/">this version</a> by Nicholas C. Zakas but adds an extra option to load an array of Javascript files.</p>
<p><a href="http://github.com/hay/jsdynaload">Fork it on Github</a> or get a <a href="http://github.com/hay/jsdynaload/raw/master/jsdynaload.min.js">minified version</a>.</p>
<p>Here&#8217;s how  you use it:</p>
<pre>// Loading a single file
jsDynaLoad("single.js", function() {
    alert("callback after the single file");
});

// Loading an array of files
var files = ["1.js", "2.js"];
jsDynaLoad(files, function() {
    alert("callback after the array of files");
});

// A callback is not required
jsDynaLoad("nocallback.js");</pre>
<p>To get a better performance remember to place your scripts at the bottom of your page, close to the closing <tt>&lt;/body&gt;</tt> tag. You can also include the minified version of loadScript inline in a <tt>&lt;script&gt;</tt> tag to save a HTTP request.</p>
<img class="colorbox-1290"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1290&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/07/05/dynamic-javascript-loader-with-multi-file-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Javascript to make Freemarker errors less intrusive</title>
		<link>http://www.haykranen.nl/2010/07/02/how-to-use-javascript-to-make-freemarker-errors-less-intrusive/</link>
		<comments>http://www.haykranen.nl/2010/07/02/how-to-use-javascript-to-make-freemarker-errors-less-intrusive/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 09:43:43 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[tutorial / howto]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1286</guid>
		<description><![CDATA[When using Freemarker in Magnolia, you often get errors. For example, because you tried to use an undefined value and didn&#8217;t add the required &#8216;!&#8217; symbol. When that happens you see the infamous red-on-yellow &#8220;FreeMarker template error!&#8221;. During development, that&#8217;s not a problem, but on a production site you don&#8217;t want to confuse your visitors [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-1287 colorbox-1286" title="freemarker_javascript" src="http://www.haykranen.nl/wp-content/uploads/2010/07/freemarker_javascript-300x178.png" alt="" width="300" height="178" /></p>
<p>When using <a href="http://www.freemarker.org">Freemarker</a> in <a href="http://www.magnolia-cms.com">Magnolia</a>, you often get errors. For example, because you tried to use an undefined value and didn&#8217;t add the required &#8216;!&#8217; symbol. When that happens you see the infamous red-on-yellow &#8220;FreeMarker template error!&#8221;. During development, that&#8217;s not a problem, but on a production site you don&#8217;t want to confuse your visitors with cryptic Java errors.</p>
<p>Unfortunately, it&#8217;s not that easy to turn those errors off, and you probably do want people to report these errors because they might indicate a serious bug in your website.</p>
<p>For this purpose i wrote a small Javascript function that you can use to &#8216;prettify&#8217; the Freemarker error. It replaces the stacktrace with a general error message, but the user can still see the original error by clicking on a link. The script requires jQuery, which is included in the STK or can be downloaded from jQuery.com. To run in, just add it to your $(document).ready() function.</p>
<p>To view the script <a href="http://wiki.magnolia-cms.com/display/WIKI/How+to+use+Javascript+to+make+Freemarker+errors+less+intrusive">read the Magnolia wiki page</a>.</p>
<img class="colorbox-1286"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1286&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/07/02/how-to-use-javascript-to-make-freemarker-errors-less-intrusive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Konami code using jQuery</title>
		<link>http://www.haykranen.nl/2010/05/07/konami/</link>
		<comments>http://www.haykranen.nl/2010/05/07/konami/#comments</comments>
		<pubDate>Fri, 07 May 2010 17:33:15 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>
		<category><![CDATA[tutorial / howto]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1221</guid>
		<description><![CDATA[The Konami code is a pretty cool way to hide easter eggs on your website. If you want to include the code on your site but something like Konami-JS is a little too heavy you could try this small jQuery snippet. function konami(fn) { var input = ""; var pattern = "3838404037393739666513"; $(document).keydown(function(e) { input [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1222 colorbox-1221" title="800px-Konami_Code.svg" src="http://www.haykranen.nl/wp-content/uploads/2010/05/800px-Konami_Code.svg_.png" alt="" width="502" height="47" /></p>
<p>The <a href="http://en.wikipedia.org/wiki/Konami_code">Konami code</a> is a pretty cool way to hide easter eggs on your website. If you want to include the code on your site but something like <a href="http://www.snaptortoise.com/konami-js/">Konami-JS</a> is a little too heavy you could try this small jQuery snippet.</p>
<pre>
function konami(fn) {
    var input = "";
    var pattern = "3838404037393739666513";
    $(document).keydown(function(e) {
        input += e.keyCode;
        if (input.indexOf(pattern) !== -1) {
            fn();
            input = "";
        }
    });
}
</pre>
<p>The function gets one argument: a function that is executed when the code is passed correctly. Use it like this:</p>
<pre>$(document).ready(function() {
    konami(function() {
        alert("You did the Konami! W00t!");
    });
});
</pre>
<img class="colorbox-1221"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1221&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/05/07/konami/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 beta 1 documentation</title>
		<link>http://www.haykranen.nl/2010/04/05/wp30/</link>
		<comments>http://www.haykranen.nl/2010/04/05/wp30/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 12:47:04 +0000</pubDate>
		<dc:creator>Hay</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ict+web]]></category>

		<guid isPermaLink="false">http://www.haykranen.nl/?p=1214</guid>
		<description><![CDATA[The first beta of WordPress 3.0 is out. That&#8217;s nice because you can update the themes that you developed to take advantage of all the new features. However, documentation for WP 3.0 is lacking, especially in terms of new functions and global variables. So, i ran PHPxref to make documentation for this new beta. Check [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-1215 colorbox-1214" title="23-wordpress_logo" src="http://www.haykranen.nl/wp-content/uploads/2010/04/23-wordpress_logo-300x300.png" alt="" width="216" height="216" /></p>
<p>The <a href="http://wordpress.org/development/2010/04/wordpress-3-0-beta-1/">first beta of WordPress 3.0</a> is out. That&#8217;s nice because you can update the themes that you developed to take advantage of all the new features. However, documentation for WP 3.0 is lacking, especially in terms of new functions and global variables. So, i ran <a href="http://phpxref.sourceforge.net/">PHPxref</a> to make documentation for this new beta.</p>
<p><a href="http://www.bykr.org/doc/wp30beta1/">Check it out here</a>.</p>
<img class="colorbox-1214"  src="http://www.haykranen.nl/?ak_action=api_record_view&id=1214&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.haykranen.nl/2010/04/05/wp30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
