<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>This is a TumbleLog authored at the desks of Bandit Design. We’re a small web and graphic design studio based in Wellington, New Zealand.
Visit Bandit Design »</description><title>Bandit Design</title><generator>Tumblr (3.0; @bandit)</generator><link>http://blog.bandit.co.nz/</link><item><title>Domestic Conflict, Explained By Stock Photos « The Bygone...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l8eg4uc93c1qz4awho1_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://bygonebureau.com/2010/08/09/stock-photos/"&gt;Domestic Conflict, Explained By Stock Photos « The Bygone Bureau&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1083339199</link><guid>http://blog.bandit.co.nz/post/1083339199</guid><pubDate>Wed, 08 Sep 2010 11:05:17 +1200</pubDate></item><item><title>Photo</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_l89nff7K4V1qassaoo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.bandit.co.nz/post/1073587745</link><guid>http://blog.bandit.co.nz/post/1073587745</guid><pubDate>Mon, 06 Sep 2010 16:50:40 +1200</pubDate></item><item><title>House 6, a Showcase of Contemporary Living in Brazil</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l89cn7EtcN1qz4awho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://freshome.com/2010/09/03/house-6-a-showcase-of-contemporary-living-in-brazil/"&gt;House 6, a Showcase of Contemporary Living in Brazil&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1067856839</link><guid>http://blog.bandit.co.nz/post/1067856839</guid><pubDate>Sun, 05 Sep 2010 17:01:55 +1200</pubDate></item><item><title>Found: The Future of Playgrounds | Magazine</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_l82x1pTA6v1qz4awho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.wired.com/magazine/2010/08/found_playground/"&gt;Found: The Future of Playgrounds | Magazine&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1048736946</link><guid>http://blog.bandit.co.nz/post/1048736946</guid><pubDate>Thu, 02 Sep 2010 05:39:24 +1200</pubDate></item><item><title>Version checking a Greasemonkey Script without AJAX</title><description>&lt;p&gt;Lately I’ve been updating my &lt;a href="http://blog.bandit.co.nz/post/822400923/lighthouse-plus-plus-greasemonkey-script"&gt;Lighthouse++&lt;/a&gt; script quite frequently. Every time I push a new version out, I have to attempt to notify everybody and post on my blog/twitter - this is a pain and some people are missing out on new or important features.&lt;/p&gt;
&lt;p&gt;I looked into how to do some cross-site AJAX requests to check for a new version, but it really isn’t possible with a Greasemonkey script in Chrome, due to how Chrome manages its sandbox.&lt;/p&gt;
&lt;p&gt;I tested a LOT of third party Javascript libraries that claimed to bypass any and all issues (with &lt;a href="http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/"&gt;James Padolsey’s&lt;/a&gt; solution looking amazing) — but no dice, no matter what I tried.&lt;/p&gt;
&lt;p&gt;I came up with an ingenious plan to use a PHP proxy hosted on my server, but access it via an image — if the image “loaded” then the script version was current — if not (a sneaky 404), it was out of date.&lt;/p&gt;
&lt;p&gt;The script works like a charm, you can try the &lt;a href="https://lab.bandit.co.nz/scripts/lighthouseplusplus/version.php?version=0.61"&gt;raw version here&lt;/a&gt;; anything other than (at the time of writing) 0.61 will cause a 404 error, which is then passed on to my script, and a NEW VERSION AVAILABLE message is displayed.&lt;/p&gt;
&lt;p&gt;Below is the source code for my script — it simply references a 1x1 transparent PNG image, and a blank .txt file — very easy for anybody to set up (although note it will only work if your versions are numbers):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&lt;?php
	// version files
	$file = 'version.txt';
	$image = 'version.png';
	$script = 'http://userscripts.org/scripts/show/81657';
	
	// check last modified date of version.txt, only do the version check every 6 hours max
	if($_GET['force'] || (time() - filemtime($file)) &gt;= 21600) {
		
		// get contents of userscripts page
		$html = trim(strip_tags(file_get_contents($script)));
		
		// extract the version
		preg_match('|Version:\s+([0-9\.]+)\s*|', $html, $result);
		$version = trim($result[1]);
		
		// update version.txt
		$fo = fopen($file, 'w+');
		fwrite($fo, $version);
		fclose($fo);
		
	}
	
	// grab the version from the version file if we don't already have it
	if(!$version) $version = trim(file_get_contents($file));
	
	// compare it to the version we were provided
	if($version == $_GET['version']) {
		
		// same version, output a picture
		header('Content-Type: image/png', true);
		header('Content-Transfer-Encoding: binary');
		header('Content-Length: '.filesize($image), true);
		header("Cache-Control: no-cache, must-revalidate");
		header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
		
		readfile($image);
		exit;
		
	}
	else {
		
		// different version, 404
		header('HTTP/1.1 404 Not Found');
		exit;
		
	}
?&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With a super basic &lt;code&gt;.htaccess&lt;/code&gt; file (but you don’t need this):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Options +FollowSymlinks
RewriteEngine On

RewriteRule version.png version.php [NC,QSA,L]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And the Javascript (jQuery) code looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$("&lt;img /&gt;").appendTo("body").bind("load", function() {
	// version up-to-date, everything is fine
	$(this).hide();
}).bind("error", function() {
	// version out of date!
	$("#lpp-advert").append(" — NEW VERSION AVAILABLE!");
	$(this).hide();
}).attr("src", "https://lab.bandit.co.nz/scripts/lighthouseplusplus/version.png?version=" + version);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can try it, and my script out at &lt;a href="http://userscripts.org/scripts/show/81657"&gt;&lt;a href="http://userscripts.org/scripts/show/81657"&gt;http://userscripts.org/scripts/show/81657&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1048347342</link><guid>http://blog.bandit.co.nz/post/1048347342</guid><pubDate>Thu, 02 Sep 2010 03:56:00 +1200</pubDate><category>greasemonkey</category><category>javascript</category><category>php</category><category>chrome</category></item><item><title>It's just you.</title><description>&lt;a href="http://downforeveryoneorjustme.com/downforeveryoneorjustme.com"&gt;It's just you.&lt;/a&gt;</description><link>http://blog.bandit.co.nz/post/1047554716</link><guid>http://blog.bandit.co.nz/post/1047554716</guid><pubDate>Thu, 02 Sep 2010 00:12:47 +1200</pubDate></item><item><title>Cee Lo Green - FUCK YOU (via CeeLoGreen)</title><description>&lt;object width="400" height="251"&gt;&lt;param name="movie" value="http://www.youtube.com/v/CAV0XrbEwNc&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/CAV0XrbEwNc&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="251" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=CAV0XrbEwNc"&gt;Cee Lo Green - FUCK YOU&lt;/a&gt; (via &lt;a href="http://youtube.com/user/CeeLoGreen"&gt;CeeLoGreen&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1043084096</link><guid>http://blog.bandit.co.nz/post/1043084096</guid><pubDate>Wed, 01 Sep 2010 04:56:21 +1200</pubDate></item><item><title>Lighthouse++ Update</title><description>&lt;img src="http://s3.amazonaws.com/uso_ss/10590/large.png?1283268355" align="right" hspace="10" vspace="10"/&gt;&lt;p&gt;Have updated &lt;a href="http://blog.bandit.co.nz/post/822400923/lighthouse-plus-plus-greasemonkey-script"&gt;Lighthouse++&lt;/a&gt; again, this time with more inline editing (and some performance improvements).&lt;/p&gt;
&lt;p&gt;Grab it here: &lt;a href="http://userscripts.org/scripts/show/81657"&gt;&lt;a href="http://userscripts.org/scripts/show/81657"&gt;http://userscripts.org/scripts/show/81657&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1042814259</link><guid>http://blog.bandit.co.nz/post/1042814259</guid><pubDate>Wed, 01 Sep 2010 03:32:58 +1200</pubDate><category>Lighthouse</category><category>greasemonkey</category><category>javascript</category></item><item><title>Cyanide &amp; Happiness #2144 - Explosm.net</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l80qmjKenK1qz4awho1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.explosm.net/comics/2144/"&gt;Cyanide &amp; Happiness #2144 - Explosm.net&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1042365461</link><guid>http://blog.bandit.co.nz/post/1042365461</guid><pubDate>Wed, 01 Sep 2010 01:25:30 +1200</pubDate></item><item><title>What Do I Know - OS X Tip: Lock That Screen</title><description>&lt;a href="http://whatdoiknow.org/archives/000957.shtml"&gt;What Do I Know - OS X Tip: Lock That Screen&lt;/a&gt;: &lt;p&gt;To enable it, open your Keychain Access utility in the Applications / Utility folder. Under the “View” menu at the top, select “Show Status in Menu Bar.”&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/1002772244</link><guid>http://blog.bandit.co.nz/post/1002772244</guid><pubDate>Tue, 24 Aug 2010 21:49:11 +1200</pubDate></item><item><title>Bed That Appears to be Floating in Air : Dylan Modern...</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_l7d6c9FyUU1qz4awho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://freshome.com/2010/08/17/bed-that-appears-to-be-floating-in-air-dylan-modern-leather-bed/"&gt;Bed That Appears to be Floating in Air : Dylan Modern Leather Bed&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/973387327</link><guid>http://blog.bandit.co.nz/post/973387327</guid><pubDate>Thu, 19 Aug 2010 08:02:32 +1200</pubDate></item><item><title>HTML5 Reset</title><description>&lt;a href="http://html5reset.org/"&gt;HTML5 Reset&lt;/a&gt;: &lt;p&gt;Like a lot of developers, we start every HTML project with the same set of HTML and CSS templates. We’ve been using these files for a long time and we’ve progressively added bits and pieces to them as our own personal best practices have evolved.&lt;/p&gt;
&lt;p&gt;Now that modern browsers are starting to support some of the really useful parts of HTML5 and CSS3, it’s time for an update, and we thought we’d put it out there for everyone to use. By no means do we see this as the end-all and beat-all, but we think it’s a fairly good starting place that anyone can take and make their own.&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/973299407</link><guid>http://blog.bandit.co.nz/post/973299407</guid><pubDate>Thu, 19 Aug 2010 07:40:19 +1200</pubDate></item><item><title>My $1.9 Million Ride in a Bugatti Veyron</title><description>&lt;script src="http://player.ooyala.com/player.js?height=380&amp;embedCode=l0MG1uMTr7aza2Yz5e0Tw2hrzcfv0tcS&amp;deepLinkEmbedCode=l0MG1uMTr7aza2Yz5e0Tw2hrzcfv0tcS&amp;width=500"&gt;&lt;/script&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.crunchgear.com/2010/08/17/my-1-9-million-ride-in-a-bugatti-veyron/"&gt;My $1.9 Million Ride in a Bugatti Veyron&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/972828415</link><guid>http://blog.bandit.co.nz/post/972828415</guid><pubDate>Thu, 19 Aug 2010 05:33:00 +1200</pubDate></item><item><title>Banana - Wikipedia</title><description>&lt;a href="http://en.wikipedia.org/wiki/Banana"&gt;Banana - Wikipedia&lt;/a&gt;: &lt;p&gt;This is a surprisingly interesting article. Bananas are awesome!&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/972645038</link><guid>http://blog.bandit.co.nz/post/972645038</guid><pubDate>Thu, 19 Aug 2010 04:41:29 +1200</pubDate></item><item><title>Shamantis - J. BIEBZ - U SMILE 800% SLOWER - SoundCloud</title><description>&lt;a href="http://soundcloud.com/shamantis/j-biebz-u-smile-800-slower"&gt;Shamantis - J. BIEBZ - U SMILE 800% SLOWER - SoundCloud&lt;/a&gt;: &lt;p&gt;This is actually awesome&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/968634732</link><guid>http://blog.bandit.co.nz/post/968634732</guid><pubDate>Wed, 18 Aug 2010 09:54:33 +1200</pubDate></item><item><title>Extinct, King Koopa-Style Giant Turtle Found on Pacific Island |...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_l7bcexiOyJ1qz4awho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.wired.com/wiredscience/2010/08/last-giant-land-turtle/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29"&gt;Extinct, King Koopa-Style Giant Turtle Found on Pacific Island | Wired Science | Wired.com&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/968221504</link><guid>http://blog.bandit.co.nz/post/968221504</guid><pubDate>Wed, 18 Aug 2010 08:18:33 +1200</pubDate></item><item><title>jQuery Wrap Not Working?</title><description>&lt;p&gt;Are you trying to use &lt;code&gt;.wrap()&lt;/code&gt; in jQuery only to find it isn’t working?&lt;/p&gt;
&lt;p&gt;Something &lt;a href="http://api.jquery.com/wrap/"&gt;the docs&lt;/a&gt; don’t tell you is that you can only wrap elements that are attached to the DOM! Important.&lt;/p&gt;
&lt;p&gt;Take for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$("&lt;a href='#'&gt;My Link&lt;/a&gt;").wrap("&lt;li&gt;&lt;/li&gt;").appendTo("ul:first").click(function() { ... } ); // will not work&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;$("&lt;a href='#'&gt;My Link&lt;/a&gt;").appendTo("ul:first").wrap("&lt;li&gt;&lt;/li&gt;").click(function() { ... } ); // will work fine!&lt;/code&gt;&lt;/pre&gt;</description><link>http://blog.bandit.co.nz/post/947175929</link><guid>http://blog.bandit.co.nz/post/947175929</guid><pubDate>Sat, 14 Aug 2010 00:58:00 +1200</pubDate><category>javascript</category><category>jquery</category></item><item><title>Man Scrawls World’s Biggest Message With GPS ‘Pen’ | Wired.com</title><description>&lt;a href="http://www.wired.com/gadgetlab/2010/08/worlds-biggest-writing/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29"&gt;Man Scrawls World’s Biggest Message With GPS ‘Pen’ | Wired.com&lt;/a&gt;</description><link>http://blog.bandit.co.nz/post/946688064</link><guid>http://blog.bandit.co.nz/post/946688064</guid><pubDate>Fri, 13 Aug 2010 22:05:19 +1200</pubDate></item><item><title>Galactic One</title><description>&lt;object type="application/x-shockwave-flash" width="400" height="300" data="http://vimeo.com/moogaloop.swf?clip_id=13972277&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF"&gt;&lt;param name="quality" value="best" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="scale" value="showAll" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13972277&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF" /&gt;&lt;embed src="http://www.vimeo.com/moogaloop.swf?clip_id=13972277&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://vimeo.com/13972277"&gt;Galactic One&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/943410469</link><guid>http://blog.bandit.co.nz/post/943410469</guid><pubDate>Fri, 13 Aug 2010 07:25:07 +1200</pubDate></item><item><title>IKEA Assembly Service Ads by Grabarz &amp; Partner</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l71e1pDGnz1qz4awho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://freshome.com/2010/08/11/ikea-assembly-service-ads-by-grabarz-partner/"&gt;IKEA Assembly Service Ads by Grabarz &amp; Partner&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.bandit.co.nz/post/941810093</link><guid>http://blog.bandit.co.nz/post/941810093</guid><pubDate>Thu, 12 Aug 2010 23:17:48 +1200</pubDate></item></channel></rss>
