<?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>pixelbreaker</title>
	<atom:link href="http://blog.pixelbreaker.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.pixelbreaker.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 17:02:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Development with Mobile devices/VMs and local hosting</title>
		<link>http://blog.pixelbreaker.com/mac/devices-host-proxy-hosts</link>
		<comments>http://blog.pixelbreaker.com/mac/devices-host-proxy-hosts#comments</comments>
		<pubDate>Wed, 11 Jan 2012 16:38:21 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/?p=196</guid>
		<description><![CDATA[I&#8217;ve longed for a way to avoid having duplicate host files on all my virtual machines for a while now. And when I relalised there was is no way on iPad to modify hosts, I had to find a way. Here&#8217;s my solution, using a proxy on my host machine, and pointing iPad, mobile, and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve longed for a way to avoid having duplicate host files on all my virtual machines for a while now. And when I relalised there was is no way on iPad to modify hosts, I had to find a way. Here&#8217;s my solution, using a proxy on my host machine, and pointing iPad, mobile, and Virtual Box guest OSes to the proxy.<br />
<span id="more-196"></span></p>
<p>If you care at all about developing good websites, then you test on platforms other then the one you chose. These days, this includes mobile and tablet devices. I&#8217;m lucky with my latest projects, the target browsers are FF6+, Google Chrome, Safari 5 and iPad iOS5.</p>
<p>I usually host sites I&#8217;m developing locally, a simple LAMP setup. I then add a pseudo-domain to my hosts file <code>/etc/hosts</code> along these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">127.0.0.1       portfolio.<span style="color: #660066;">dev</span>
127.0.0.1       blog.<span style="color: #660066;">dev</span></pre></div></div>

<p>This is all well and good when I&#8217;m accessing the server from my own machine (which relies on this host file before DNS servers), but when inside a VM (Virtual Machine, I use <a href="https://www.virtualbox.org/">VirtualBox</a> running Win XP/7 and Ubuntu) testing, you have to mess about doing the same hacks to the windows/linux hosts file, and working out what the IP of the host OS is. I got sick of doing this.</p>
<p>And to top this off, when I got an iPad for testing, upon realising there is no hosts file, had to find another solution. This is where a local proxy server comes in. I&#8217;ve used <a href="http://www.charlesproxy.com/">Charles: Web Debugging</a> Proxy for years. It&#8217;s perfect for inspecting requests and responses, can handles many types of data, AMF, JSON etc. Basically, it makes web application development a hell of a lot easier!</p>
<p>I then googled a bit, and found that if I set an HTTP proxy on the iPad, it would route DNS requests through there too. So the hosts file on my development machine, would work on the iPad!!! Simply start up Charles, then go to your WiFi settings on the iPad and configure the HTTP proxy. By default, Charles uses the port 8888.</p>
<p>You can also add these settings in any Virtual Machines you&#8217;re running on your machine. I&#8217;ve tested this in Windows XP and Windows 7 running on Virtual Box. If anyone tests this on Parallels, please let me know if it works.</p>
<p>Here&#8217;s some example configs on iPad and Windows 7 running in Virtual Box.<br/><br />
<a href="http://blog.pixelbreaker.com/wp-content/uploads/2012/01/iPad-Proxy.png"><img src="http://blog.pixelbreaker.com/wp-content/uploads/2012/01/iPad-Proxy-300x225.png" alt="" title="iPad Proxy" width="300" height="225" class="alignleft size-medium wp-image-199" style="display: inline-block;" /></a><br />
<a href="http://blog.pixelbreaker.com/wp-content/uploads/2012/01/Screen-Shot-2012-01-11-at-16.28.08.png"><img src="http://blog.pixelbreaker.com/wp-content/uploads/2012/01/Screen-Shot-2012-01-11-at-16.28.08-300x229.png" alt="" title="Screen Shot 2012-01-11 at 16.28.08" width="300" height="229" class="alignleft size-medium wp-image-201" style="display: inline-block;" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/mac/devices-host-proxy-hosts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Takeover Loader</title>
		<link>http://blog.pixelbreaker.com/jquery/takeover-loader</link>
		<comments>http://blog.pixelbreaker.com/jquery/takeover-loader#comments</comments>
		<pubDate>Sat, 11 Jun 2011 22:21:29 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/?p=177</guid>
		<description><![CDATA[A really simple jQuery plugin I&#8217;ve just written for my portfolio part of this site. When the document is &#8216;ready&#8217; call takeoverloader() on jQuery results (desired DOM elements). In my case I used $(document). It will then track all img elements in the children of your chosen element and report progress and completion of the [...]]]></description>
			<content:encoded><![CDATA[<p>A really simple jQuery plugin I&#8217;ve just written for <a href="http://www.pixelbreaker.com">my portfolio</a> part of this site.</p>
<p>When the document is &#8216;ready&#8217; call takeoverloader() on jQuery results (desired DOM elements). In my case I used $(document). It will then track all <code>img</code> elements in the children of your chosen element and report progress and completion of the loading process.</p>
<p>It will ignore <code>img</code> tags with an empty <code>src</code> attribute, or a class of <code>.noloader</code></p>
<p>So you&#8217;re initial code would be something along these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// hide content div (UI being loaded)</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#content'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// takeover the loading.</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">takeoverloader</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span>
		progress<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> progressAmount <span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// called each time an item is loaded</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// do something with progressAmout (normalised)</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.loadprogress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span> progressAmount <span style="color: #339933;">*</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'%'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		complete<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// called when loading is finished</span>
			<span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.loadprogress'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#content'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #006600; font-style: italic;">// etc</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// To forcibly remove events, call 'destroy'</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">takeoverloader</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'destroy'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It&#8217;s up on github, and there&#8217;s also a minified (google closure compiled) version in the repo too.</p>
<p>Links:<br />
<a href="http://github.com/pixelbreaker/pixelbreaker_jquery/tree/master/takeoverloader" target="_blank">http://github.com/pixelbreaker/pixelbreaker_jquery/tree/master/takeoverloader</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/jquery/takeover-loader/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tiny, fast javascript with Google Closure-Compiler</title>
		<link>http://blog.pixelbreaker.com/javascript/tiny-fast-javascript-with-google-closure-compiler</link>
		<comments>http://blog.pixelbreaker.com/javascript/tiny-fast-javascript-with-google-closure-compiler#comments</comments>
		<pubDate>Sat, 28 May 2011 10:02:29 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/?p=135</guid>
		<description><![CDATA[I&#8217;ve just spent a few hours trying to clean up the javascript on a project that&#8217;s about to launch, and I&#8217;m really impressed with Google&#8217;s Closure-compiler, it&#8217;s available online, as a Rest API or as a java app. I&#8217;ve been running it on my machine, with a shell script to batch the compilation of .js [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just spent a few hours trying to clean up the javascript on a project that&#8217;s about to launch, and I&#8217;m really impressed with <a href="http://code.google.com/closure/compiler/docs/overview.html">Google&#8217;s Closure-compiler</a>, it&#8217;s available online, as a Rest API or as a java app. I&#8217;ve been running it on my machine, with a shell script to batch the compilation of .js files.</p>
<p>It not a &#8216;real&#8217; compiler, it doesn&#8217;t produce machine code, but it not only shortens your code, such as variable names etc, it also optimises it, to make it more efficient.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//before closure compiler</span>
<span style="color: #003366; font-weight: bold;">var</span> settings <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> maxZoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span><span style="color: #339933;">,</span> gridSize<span style="color: #339933;">:</span> <span style="color: #CC0000;">65</span><span style="color: #339933;">,</span> styles<span style="color: #339933;">:</span> clusterStyles <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!!</span>markerClusterer <span style="color: #009900;">&#41;</span> markerClusterer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
markerClusterer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MarkerClusterer<span style="color: #009900;">&#40;</span> map<span style="color: #339933;">,</span> markers<span style="color: #339933;">,</span> settings <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// after</span>
j<span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span>j<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>j<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> MarkerClusterer<span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> markers<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> maxZoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span><span style="color: #339933;">,</span> gridSize<span style="color: #339933;">:</span> <span style="color: #CC0000;">65</span><span style="color: #339933;">,</span> styles<span style="color: #339933;">:</span> clusterStyles <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><span id="more-135"></span><br />
It also works out that the clusterStyles object is only ever used once (in the constructor of MarkerClusterer) so it moves the object itself to be inline in the constructor call. It&#8217;s all very clever, and hasn&#8217;t broken a single bit of .js (yet!).</p>
<p>my jscompile.sh looks like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#############################################################</span>
<span style="color: #666666; font-style: italic;"># JAVSCRIPT COMPILE SHELL SCRIPT							#</span>
<span style="color: #666666; font-style: italic;"># Written by Gabriel Bucknall (gabriel@pixelbreaker.com)	#</span>
<span style="color: #666666; font-style: italic;">#############################################################</span>
<span style="color: #666666; font-style: italic;"># optimisation=&quot;ADVANCED_OPTIMIZATIONS&quot; # USE WITH CAUTION</span>
<span style="color: #666666; font-style: italic;"># optimisation=&quot;SIMPLE_OPTIMIZATIONS&quot;</span>
&nbsp;
compile_js_one<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #007800;">inputpath</span>=<span style="color: #ff0000;">&quot;../deploy/public/_includes/js/&quot;</span>
	<span style="color: #007800;">outputfile</span>=<span style="color: #ff0000;">&quot;../deploy/public/_includes/js-compiled/all.js&quot;</span>
	<span style="color: #007800;">files</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;constants.js&quot;</span> <span style="color: #ff0000;">&quot;sitemap.js&quot;</span> <span style="color: #ff0000;">&quot;sitedata.js&quot;</span> <span style="color: #ff0000;">&quot;siteintro.js&quot;</span> <span style="color: #ff0000;">&quot;siteform.js&quot;</span> <span style="color: #ff0000;">&quot;sitegallery.js&quot;</span> <span style="color: #ff0000;">&quot;deeplinking.js&quot;</span> <span style="color: #ff0000;">&quot;sidebar.js&quot;</span> <span style="color: #ff0000;">&quot;init.js&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #007800;">filesin</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------------------------------------------------------&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling files in &quot;</span><span style="color: #007800;">$inputpath</span><span style="color: #ff0000;">&quot; to &quot;</span><span style="color: #007800;">$outputfile</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------------------------------------------------------&quot;</span>
	<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${files[@]}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #007800;">filesin</span>=<span style="color: #007800;">$filesin</span><span style="color: #ff0000;">&quot;--js=&quot;</span><span style="color: #007800;">$inputpath</span><span style="color: #007800;">$i</span><span style="color: #ff0000;">&quot; &quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling &quot;</span><span style="color: #007800;">$i</span>
	<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
	java <span style="color: #660033;">-jar</span> compiler.jar <span style="color: #007800;">$filesin</span>--js_output_file=<span style="color: #007800;">$outputfile</span> --compilation_level SIMPLE_OPTIMIZATIONS <span style="color: #666666; font-style: italic;">#--externs ../deploy/public/_includes/js/externs/externs.js --externs ../deploy/public/_includes/js/externs/jquery-externs.js --externs ../deploy/public/_includes/js/externs/googlemaps.js</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling complete.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
compile_libs_one<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #007800;">inputpath</span>=<span style="color: #ff0000;">&quot;../deploy/public/_includes/js/library/&quot;</span>
	<span style="color: #007800;">outputfile</span>=<span style="color: #ff0000;">&quot;../deploy/public/_includes/js-compiled/libs.js&quot;</span>
	<span style="color: #007800;">files</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;jquery.address-1.4.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.easing.1.3.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.jcarousel.min.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.jscrollpane.min.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.mousewheel.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.simplemodal.js&quot;</span> <span style="color: #ff0000;">&quot;jquery.uploadify.v2.1.4.min.js&quot;</span> <span style="color: #ff0000;">&quot;markerclusterer.js&quot;</span> <span style="color: #ff0000;">&quot;modernizr-1.7.min.js&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #007800;">filesin</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------------------------------------------------------&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling files in &quot;</span><span style="color: #007800;">$inputpath</span><span style="color: #ff0000;">&quot; to &quot;</span><span style="color: #007800;">$outputfile</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------------------------------------------------------&quot;</span>
	<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${files[@]}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #007800;">filesin</span>=<span style="color: #007800;">$filesin</span><span style="color: #ff0000;">&quot;--js=&quot;</span><span style="color: #007800;">$inputpath</span><span style="color: #007800;">$i</span><span style="color: #ff0000;">&quot; &quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling &quot;</span><span style="color: #007800;">$i</span>
	<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
	java <span style="color: #660033;">-jar</span> compiler.jar <span style="color: #007800;">$filesin</span>--js_output_file=<span style="color: #007800;">$outputfile</span> --compilation_level SIMPLE_OPTIMIZATIONS
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;compiling complete.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span>
	JS<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
		compile_js_one
		<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
	JS_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
		compile_libs_one
		<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
	ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		compile_libs_one
		compile_js_one
		<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
	--help<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Use one of the following options&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;JS		Compile the JS group of files&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;JS_LIBS		Compile the JS_LIBS group of files&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ALL		Compile all file groups&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;add --help parameter for help.&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p>This takes all the specified files and compresses the hell out of them, then outputs them to one file (for each group I&#8217;ve set up). Some libraries wont compile though, such as shadowbox, as it&#8217;s already been compiled via Yahoo&#8217;s YUI system, and seems to break after closure compiler has tried to rebuild it. I then serve them to the client via <a href="http://code.google.com/p/minify/">Minify</a> to make sure they&#8217;re even smaller, and gzipped where applicable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/javascript/tiny-fast-javascript-with-google-closure-compiler/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PolarClock3 for Snow Leopard</title>
		<link>http://blog.pixelbreaker.com/mac/polarclock3-for-snow-leopard</link>
		<comments>http://blog.pixelbreaker.com/mac/polarclock3-for-snow-leopard#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:58:33 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Screensaver]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/?p=129</guid>
		<description><![CDATA[I&#8217;ve had some time this morning to wrap the screensaver up in something other than screentime, and it all works perfectly for me. My first delve into Cocoa. Thanks Si Heys for the code I needed for this. Please have a go and let me know if it works ok on Snow Leopard, and also [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had some time this morning to wrap the screensaver up in something other than screentime, and it all works perfectly for me. My first delve into Cocoa. Thanks <a href="http://www.simonheys.com" target="_blank">Si Heys </a>for the code I needed for this.</p>
<p>Please have a go and let me know if it works ok on Snow Leopard, and also older OSes, if there&#8217;s problems, comment here, and I&#8217;ll try and rectify any issues.</p>
<p>You can <a href="http://blog.pixelbreaker.com/downloads/polarclock/PolarClock3_osx_snow_leopard.zip">download it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/mac/polarclock3-for-snow-leopard/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>jQuery plugins coming soon.</title>
		<link>http://blog.pixelbreaker.com/jquery/jquery-plugins-coming-soon</link>
		<comments>http://blog.pixelbreaker.com/jquery/jquery-plugins-coming-soon#comments</comments>
		<pubDate>Wed, 09 Dec 2009 16:32:09 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/flash/jquery-plugins-coming-soon/</guid>
		<description><![CDATA[Pretty soon, I&#8217;ll be releasing two plugins for jQuery. They are re-writes of my current javascript extensions to SWFObject. One for full browser flash with a minimum width and height. And an updated version of the MouseWheel enabler for Macs. I&#8217;ve gone for jQuery as I&#8217;ve been using it a fair bit recently with jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>Pretty soon, I&#8217;ll be releasing two plugins for jQuery.</p>
<p>They are re-writes of my current javascript extensions to SWFObject. One for full browser flash with a minimum width and height. And an updated version of the MouseWheel enabler for Macs.</p>
<p>I&#8217;ve gone for jQuery as I&#8217;ve been using it a fair bit recently with <a href="http://jquery.thewikies.com/swfobject/" target="_blank">jQuery SWFObject</a>, and it&#8217;s super easy to work with.</p>
<p>Here&#8217;s an example of a full browser flash object, with a minimum width/height. The best thing being that there is no requirement for fiddly CSS to make the full browser view work, the CSS is all implemented by jQuery!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// add an extra class to the &lt;body&gt; element for JS-only styling</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;js&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	$.<span style="color: #660066;">flash</span>.<span style="color: #660066;">expressInstaller</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'_includes/expressInstall.swf'</span><span style="color: #339933;">;</span> 
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> $.<span style="color: #660066;">flash</span>.<span style="color: #660066;">hasVersion</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">9.1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> mainFlash <span style="color: #339933;">=</span> $.<span style="color: #660066;">flash</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>   
				swf<span style="color: #339933;">:</span> <span style="color: #3366CC;">'FlashApplication.swf'</span><span style="color: #339933;">,</span>
				width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span>
				height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span>
				id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'FlashApplicationSwf'</span><span style="color: #339933;">,</span>
				<span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'FlashApplicationSwf'</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		SWFAddress.<span style="color: #660066;">setId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'FlashApplication'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flashContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span> mainFlash <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flashContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fullFlashMinSize</span><span style="color: #009900;">&#40;</span> <span style="color: #CC0000;">800</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">600</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>		
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/jquery/jquery-plugins-coming-soon/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wired article</title>
		<link>http://blog.pixelbreaker.com/play/wired-article</link>
		<comments>http://blog.pixelbreaker.com/play/wired-article#comments</comments>
		<pubDate>Sun, 22 Feb 2009 09:08:29 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[Play]]></category>
		<category><![CDATA[Screensaver]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/flash/wired-article/</guid>
		<description><![CDATA[Wired got in touch a while ago asking about the PolarClock, and I&#8217;ve finally seen the finished article, it looks great! pic after the jump&#8230;]]></description>
			<content:encoded><![CDATA[<p>Wired got in touch a while ago asking about the PolarClock, and I&#8217;ve finally seen the finished article, it looks great!</p>
<p>pic after the jump&#8230;</p>
<p><span id="more-70"></span><br />
<img src="http://blog.pixelbreaker.com/wp-content/uploads/2009/02/photo.jpg" alt="Photo" border="1" height="600" hspace="4" vspace="4" width="450" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/play/wired-article/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone PolarClock released</title>
		<link>http://blog.pixelbreaker.com/screensaver/iphone-polarclock-released</link>
		<comments>http://blog.pixelbreaker.com/screensaver/iphone-polarclock-released#comments</comments>
		<pubDate>Thu, 19 Feb 2009 12:23:19 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[Screensaver]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/screensaver/iphone-polarclock-released/</guid>
		<description><![CDATA[Ed Kauffmann over at RayFlex has been busy developing the iPhone release of the PolarClock. It&#8217;s now ready and released at version 1.0. If you buy this application you will get free upgrades to future versions. Money raised from the sales of the iPhone version will go towards further development of both the iPhone and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.pixelbreaker.com/wp-content/uploads/2009/02/screenshot2.jpg" alt="Screenshot2" border="1" height="480" hspace="4" vspace="4" width="320" /></p>
<p>Ed Kauffmann over at <a href="http://www.rayflex.com/iphone/polarclock/" target="_blank">RayFlex</a> has been busy developing the iPhone release of the PolarClock. It&#8217;s now ready and released at version 1.0. If you buy this application you will get free upgrades to future versions. Money raised from the sales of the iPhone version will go towards further development of both the iPhone and Mac/PC versions of the PolarClock.</p>
<p>It has a few new features, my favourite being the moon phase at the centre of the concentric rings. Good work ed.</p>
<p>You can get a copy here:<br />
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301015085&amp;mt=8"><img src="http://www.rayflex.com/iphone/arctic/appstore.jpg" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/screensaver/iphone-polarclock-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play Balloonacy</title>
		<link>http://blog.pixelbreaker.com/play/play-balloonacy</link>
		<comments>http://blog.pixelbreaker.com/play/play-balloonacy#comments</comments>
		<pubDate>Tue, 24 Jun 2008 12:36:45 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Play]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/flash/actionscript-30/play-balloonacy/</guid>
		<description><![CDATA[Myself and the top notch team of internet professionals at Poke have just finished this monster project, check it out. It&#8217;s mental.]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.pixelbreaker.com/wp-content/uploads/2008/06/raceacrosstheinternet.jpg" alt="raceacrosstheinternet.jpg" /></p>
<p>Myself and the top notch team of <em>internet professionals </em>at <a href="http://www.pokelondon.com/">Poke</a> have just finished this monster project, <a href="http://www.playballoonacy.com">check it out</a>. It&#8217;s mental.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/play/play-balloonacy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3.0 MouseWheel on Mac OS X</title>
		<link>http://blog.pixelbreaker.com/mac/as30-mousewheel-on-mac-os-x</link>
		<comments>http://blog.pixelbreaker.com/mac/as30-mousewheel-on-mac-os-x#comments</comments>
		<pubDate>Wed, 06 Feb 2008 23:34:56 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/</guid>
		<description><![CDATA[I&#8217;ve finally found the time to port my SWFObject add-on SWFMacMouseWheel (catchy I know) to ActionScript 3.0 and SWFObject 2.0 There&#8217;s now two examples in the zip, one for use with SWFObject 1.5, and a totally re-written version for use with SWFObject 2.0 (formerly SWFFix) All you have to do in your main application class [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally found the time to port my SWFObject add-on SWFMacMouseWheel (catchy I know) to ActionScript 3.0 and SWFObject 2.0</p>
<p>There&#8217;s now two examples in the zip, one for use with <a href="http://blog.deconcept.com/swfobject/">SWFObject 1.5</a>, and a totally re-written version for use with <a href="http://code.google.com/p/swfobject/">SWFObject 2.0</a> (formerly SWFFix)</p>
<p>All you have to do in your main application class (or document class) is</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">pixelbreaker</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">osx</span>.<span style="color: #006600;">MacMouseWheel</span>;
&nbsp;
MacMouseWheel.<span style="color: #006600;">setup</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">stage</span> <span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>You can then add listeners to TextFields, Sprites etc etc as you normally would any other MouseEvent.</p>
<p>Example JavaScript to be used with the dynamic embed method</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> vars <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> scale<span style="color: #339933;">:</span><span style="color: #3366CC;">'noScale'</span><span style="color: #339933;">,</span> salign<span style="color: #339933;">:</span><span style="color: #3366CC;">'lt'</span><span style="color: #339933;">,</span> menu<span style="color: #339933;">:</span><span style="color: #3366CC;">'false'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> attributes <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #3366CC;">'testObject'</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'testObject'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// give an id to the flash object</span>
&nbsp;
swfobject.<span style="color: #660066;">embedSWF</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;test_as3.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;flashContent&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;9.0.0&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;js/expressInstall.swf&quot;</span><span style="color: #339933;">,</span> vars<span style="color: #339933;">,</span> params<span style="color: #339933;">,</span> attributes <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
swfmacmousewheel.<span style="color: #660066;">registerObject</span><span style="color: #009900;">&#40;</span>attributes.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I have updated the SWFObject 2.0 version to be more compact, and it also falls inline with the code style of SWFObject2.0. see <em>swfmacmousewheel_src.js</em> for the uncompressed version, deploy <em>swfmacmousewheel2.js</em> on your site.</p>
<p>Download <a href="http://blog.pixelbreaker.com/downloads/swfmacmousewheel_as3.zip">source and demo here</a> or view the <a href="http://blog.pixelbreaker.com/downloads/swfmacmousewheelas3demo/index_as3.html">demo online</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/mac/as30-mousewheel-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3.0 Memory monitoring</title>
		<link>http://blog.pixelbreaker.com/actionscript-3-0/as30-memory-monitoring</link>
		<comments>http://blog.pixelbreaker.com/actionscript-3-0/as30-memory-monitoring#comments</comments>
		<pubDate>Fri, 09 Nov 2007 10:43:26 +0000</pubDate>
		<dc:creator>gabes</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://blog.pixelbreaker.com/flash/as30-memory-monitoring/</guid>
		<description><![CDATA[I just came across the property System.totalMemory. It&#8217;s very useful, especially for the engine I am currently working on, and dealing with AS3 garbage collection. It returns the memory currently being used by the Flash Player. It&#8217;s in bytes so it pays to clean it up slightly. [as] var mem:String = Number( System.totalMemory / 1024 [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across the property <em>System.totalMemory</em>. It&#8217;s very useful, especially for the engine I am currently working on, and dealing with AS3 garbage collection.</p>
<p>It returns the memory currently being used by the Flash Player.  It&#8217;s in bytes so it pays to clean it up slightly.</p>
<p>[as]<br />
var mem:String = Number( System.totalMemory / 1024 / 1024 ).toFixed( 2 ) + &#8216;Mb&#8217;;<br />
trace( mem ); // eg traces &#8220;24.94Mb&#8221;<br />
[/as]</p>
<p>It seems this takes account of all instances of the flash player. For example, I have a logger/debug panel running in the sidebar of firefox, built in flex. As soon as I open this and it&#8217;s initialised, it uses an extra 5 &#8211; 10mb of ram. So be warned, if you see a massive increase in memory usage, check you don&#8217;t have loads of sites open with ad banners or other flash based stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelbreaker.com/actionscript-3-0/as30-memory-monitoring/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

