<?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>patspam</title>
	<atom:link href="http://blog.patspam.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.patspam.com</link>
	<description>patspam patspam patspam</description>
	<lastBuildDate>Fri, 18 Jun 2010 23:44:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=9950</generator>
		<item>
		<title>It&#8217;s official: WebGUI 8 will be Plack-powered</title>
		<link>http://blog.patspam.com/2010/its-official-webgui-8-will-be-plack-powered</link>
		<comments>http://blog.patspam.com/2010/its-official-webgui-8-will-be-plack-powered#comments</comments>
		<pubDate>Fri, 18 Jun 2010 23:44:02 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1392</guid>
		<description><![CDATA[Back in December 2009 I wrote about PlebGUI, an experimental branch of WebGUI with mod_perl replaced with Plack/PSGI. As a result, I was able to demonstrate WebGUI running on shared hosting via Plack + FastCGI. For the next few months I worked through the process of turning the proof of concept into something core-worthy. Primarily [...]]]></description>
			<content:encoded><![CDATA[<p>Back in December 2009 I wrote about <a href="http://blog.patspam.com/2009/plebgui-webgui-meets-plack">PlebGUI</a>, an experimental branch of <a href="http://webgui.org">WebGUI</a> with mod_perl replaced with <a href="http://plackperl.org">Plack/PSGI</a>. As a result, I was able to demonstrate WebGUI running on shared hosting via Plack + FastCGI.</p>
<p>For the next few months I worked through the process of turning the proof of concept into something core-worthy. Primarily that meant removing PlebGUI&#8217;s faked Apache2::Request object, completely eliminating any mod_perl dependencies from the WebGUI core and instead baking in WebGUI::Request and WebGUI::Response which are thin layers over <a href="http://search.cpan.org/perldoc?Plack::Request">Plack::Request</a> and <a href="http://search.cpan.org/perldoc?Plack::Response">Plack::Response</a>.</p>
<p>By about April most of the basic pieces were in place, performance was looking good, and I&#8217;d started the fun task of refactoring WebGUI to take advantage of the value-add features that Plack brings such as Middleware and stealing liberally from other Plack projects such as <a href="http://search.cpan.org/perldoc?Tatsumaki">Tatsumaki</a>&#8216;s streaming API. But there was still lots of work to be done getting the test suite passing again and smoothing off the rough edges. Progress was slow due to my work commitments and frequent travel.</p>
<p>Then three of the main WebGUI committers got involved, first <a href="http://github.com/haarg">haarg</a>++, then <a href="http://www.perldreamer.com/blog">perlDreamer</a>++ and <a href="http://github.com/preaction">preaction</a>++. The pace accelerated dramatically. This week we officially merged the PSGI branch into the <a href="http://github.com/plainblack/webgui/tree/WebGUI8">main development branch</a>, <strong>meaning that the next major release of WebGUI will officially be a PSGI app!</strong></p>
<p>Huge credit and thanks to haarg, perlDreamer and preaction (and anyone else who contributed too) for getting us over the hump. These guys are also the main driving force behind <a href="http://www.webgui.org/8">the other awesome features</a> that are being baked into WebGUI 8, so if you like anything you see in the next version, make sure you buy them a beer or two.</p>
<p>Here are some screenshots of WebGUI with the <a href="http://search.cpan.org/perldoc?Plack::Middleware::Debug">Plack::Middleware::Debug</a> bar turned on.</p>
<p><a href="http://blog.patspam.com/wp-content/uploads/2010/06/show-debug.png"><img class="aligncenter size-medium wp-image-1398" title="show-debug" src="http://blog.patspam.com/wp-content/uploads/2010/06/show-debug-300x108.png" alt="" width="300" height="108" /></a></p>
<p><a href="http://blog.patspam.com/wp-content/uploads/2010/06/webgui-psgi.png"><img class="aligncenter size-medium wp-image-1399" title="webgui-psgi" src="http://blog.patspam.com/wp-content/uploads/2010/06/webgui-psgi-267x300.png" alt="" width="267" height="300" /></a></p>
<p><a href="http://blog.patspam.com/wp-content/uploads/2010/06/asset-performance.png"><img class="aligncenter size-medium wp-image-1400" title="asset-performance" src="http://blog.patspam.com/wp-content/uploads/2010/06/asset-performance-300x62.png" alt="" width="300" height="62" /></a></p>
<p>Previously, in debug mode WebGUI would append all debug output to the bottom of the page. Now, thanks to haarg&#8217;s custom Plack::Middleware::Debug panels, debug messages are contained within the &#8220;Logger&#8221; panel. Notice also the &#8220;Asset Performance&#8221; panel, which displays WebGUI::Asset performance metrics. This is only the beginning.</p>
<p>It&#8217;s such a buzz to have the PSGI branch merged in; now the real fun starts! I&#8217;ll be speaking about the WebGUI PSGI branch at the WebGUI User Conference in Madison in September, and at the rate things are going, who knows how much fun stuff we&#8217;ll be able to show off..</p>
<p>I&#8217;m also really looking forward to attending YAPC::NA next week (my first YAPC on American soil) and meeting/hanging out with lots other people who have been doing awesome things in the Perl web app space (and beyond). Vive la renaissance Perl!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/its-official-webgui-8-will-be-plack-powered/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plack Apps in Javascript</title>
		<link>http://blog.patspam.com/2010/plack-apps-in-javascript</link>
		<comments>http://blog.patspam.com/2010/plack-apps-in-javascript#comments</comments>
		<pubDate>Thu, 17 Jun 2010 16:03:40 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1384</guid>
		<description><![CDATA[Love Plack web apps but feel like writing some Javascript today instead of Perl? # app.psgi use Plack::App::JSP; Plack::App::JSP-&#62;new( js =&#62; q{ [ 200, [ 'Content-type', 'text/html' ], [ 'Hello, World!' ] ] }); # displays: Hello, World! Given the similarities between Perl and JSON you can&#8217;t actually tell if I&#8217;m cheating or not from [...]]]></description>
			<content:encoded><![CDATA[<p>Love <a href="http://plackperl.org/">Plack web apps</a> but feel like writing some Javascript today instead of Perl?</p>
<pre class="brush: perl;">
# app.psgi
use Plack::App::JSP;
Plack::App::JSP-&gt;new( js =&gt; q{
[ 200, [ 'Content-type', 'text/html' ], [ 'Hello, World!' ] ]
});

# displays: Hello, World!
</pre>
<p>Given the similarities between Perl and JSON you can&#8217;t actually tell if I&#8217;m cheating or not from the above snippet. </p>
<p>Let&#8217;s try something more convincing:</p>
<pre class="brush: perl;">
Plack::App::JSP-&gt;new( js =&gt; q{
function respond(body) {
    return [ 200, [ 'Content-type', 'text/html' ], [ body ] ]
}

respond(&quot;Five factorial is &quot; +
    (function(x) {
      if ( x&lt;2 ) return 1;
      return x * arguments.callee(x - 1);
    })(5)
);
});

# displays: Five factorial is 120
</pre>
<p>I just pushed <a href="http://search.cpan.org/perldoc?Plack::App::JSP">Plack::App::JSP</a> to the CPAN.<br />
Thanks to Salvador Ortiz and Miguel Ibarra whose recently released <a href="http://search.cpan.org/perldoc?JSP">JSP</a> module makes this possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/plack-apps-in-javascript/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Giving Ubuntu the middle finger salute</title>
		<link>http://blog.patspam.com/2010/giving-ubuntu-the-middle-finger-salute</link>
		<comments>http://blog.patspam.com/2010/giving-ubuntu-the-middle-finger-salute#comments</comments>
		<pubDate>Tue, 08 Jun 2010 04:28:58 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Comp]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1379</guid>
		<description><![CDATA[I couldn&#8217;t find any good search engine hits for this, so I&#8217;m posting up the details to help others find it. Supposedly most Lenovo laptops contain a fingerprint reader that works nicely in Ubuntu via ThinkFinger. However my Lenovo T400s uses different hardware (Upek) that isn&#8217;t supported by ThinkFinger. You can find out what hardware [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find any good search engine hits for this, so I&#8217;m posting up the details to help others find it.</p>
<p>Supposedly most Lenovo laptops contain a fingerprint reader that works nicely in Ubuntu via <a href="https://wiki.ubuntu.com/ThinkFinger">ThinkFinger</a>. However my Lenovo T400s uses different hardware (Upek) that isn&#8217;t supported by ThinkFinger.</p>
<p>You can find out what hardware your fingerprint reading is by running:</p>
<pre class="brush: bash;">
$ lsusb | grep -i finger
Bus 004 Device 002: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor
</pre>
<p>If yours says <strong>Upek</strong> line mine does, you can get it running under Ubuntu (and Fedora etc..) by installing <a href="http://www.n-view.net/Appliance/fingerprint/">fingerprint-gui</a>. The installation process is a little tedius, but it&#8217;s worth it to be able to login/sudo/etc.. with a swipe of your finger.</p>
<p>Probably worth getting a few friends to test how susceptible the reader is to false positives though.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/giving-ubuntu-the-middle-finger-salute/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serve up Dancer webapps for six bucks</title>
		<link>http://blog.patspam.com/2010/serve-up-dancer-webapps-for-six-bucks</link>
		<comments>http://blog.patspam.com/2010/serve-up-dancer-webapps-for-six-bucks#comments</comments>
		<pubDate>Tue, 01 Jun 2010 18:36:04 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1368</guid>
		<description><![CDATA[After a few weeks of mulling over the Perl Shared Hosting idea, a few enthusiastic messages from people and getting inspired by chromatic musing about a similar idea for a Perl Cookbook, I decided to JFDI. So, perlsharedhosting.com is now officially up and running. Rather than wasting my time building a web app for the site [...]]]></description>
			<content:encoded><![CDATA[<p>After a few weeks of <a href="http://blog.patspam.com/2010/perlsharedhosting">mulling over the Perl Shared Hosting idea</a>, a few enthusiastic messages from people and getting inspired by chromatic musing about a <a href="http://www.modernperlbooks.com/mt/2010/05/a-modern-perl-fakebook.html">similar idea for a Perl Cookbook</a>, I decided to JFDI.</p>
<p>So, <a href="http://perlsharedhosting.com/">perlsharedhosting.com</a> is now officially up and running.</p>
<p>Rather than wasting my time building a web app for the site before the idea has been proven, I decided to use a simple CMS and focus my energies on the content instead (there&#8217;s a wonderful irony in using a PHP CMS to deliver content about Perl shared hosting..).</p>
<p>I&#8217;ve added quick-start guides on how to install the following core technologies on your shared hosting account:</p>
<ul>
<li><a href="http://perlsharedhosting.com/tech/locallib">local::lib</a></li>
<li><a href="http://perlsharedhosting.com/tech/cpanminus">cpanminus</a></li>
<li><a href="http://perlsharedhosting.com/tech/taskkensho">Task::Kensho</a> (the &#8220;We support modern Perl&#8221; badge of honour for hosting providers)</li>
<li><a href="http://perlsharedhosting.com/tech/plack">Plack</a></li>
<li><a href="http://perlsharedhosting.com/tech/dancer">Dancer</a></li>
</ul>
<p>These pages are not in any way supposed to replace the official documentation sources. Ideally, they just tell you what the tool/lib  is, why you need it, and how to install it with minimum fuss. In reality, we also need to list any issues you may run into when using them in a shared hosting environment, but the idea is that we feed this information back to the upstream projects so that workarounds become unnecessary.</p>
<p>I&#8217;ve tested two different hosting providers, neither of which I&#8217;m going to mention by name here because I&#8217;m not trying to actually promote their brand.</p>
<ul>
<li>The <a href="http://perlsharedhosting.com/hosting-providers/shared/hostingzoom">first one</a> had a major limitation &#8211; no access to <strong>cc</strong> and hence the inability to compile XS modules (their tech support has offered to install CPAN modules on request, but it&#8217;s less than ideal).</li>
<li>The <a href="http://perlsharedhosting.com/hosting-providers/shared/hostmonster">second one</a> has so far passed all tests with flying colours &#8211; &#8220;cpanm Task::Kensho&#8221; works flawlessly, including all the XS modules. This is perhaps not all that surprising given that this is the same hosting provider that I used last year to get <a href="http://blog.patspam.com/2009/plebgui-webgui-meets-plack">WebGUI running under PSGI on a shared account</a>.</li>
</ul>
<p>I started playing with Dancer for the first time, and soon had live demos of Dancer running in both <a href="http://hostmonster.perlsharedhosting.com/">CGI</a> and <a href="http://hostmonster.perlsharedhosting.com/fcgi/">FastCGI</a> modes. Those URLs will change in the future but the idea is that we set up live versions of each web framework running on each hosting provider. Maybe in the future we could use a monitoring service to track the reliability and response time of each combination.</p>
<p>So already, the Perl Shared Hosting site has step-by-step instructions for how to run Dancer web apps on a shared hosting account for less than six bucks per month. That&#8217;s not half bad.</p>
<p>If you have a shared hosting account on a provider that isn&#8217;t listed (or you work for a shared hosting company and want to get yourself listed) then please <a href="http://perlsharedhosting.com/contact">contact me</a> to get involved.</p>
<p>Next up, we need to add more information about resource limits. I also plan on adding more web frameworks such as <a href="http://search.cpan.org/perldoc?Web::Simple">Web::Simple</a>, <a href="http://mojomojo.org/">MojoMojo</a>, <a href="http://www.catalystframework.org/">Catalyst</a>, <a href="http://search.cpan.org/perldoc?Tatsumaki">Tatsumaki</a>, ..</p>
<p>Once we have an idea about what features are most important, I&#8217;d like to then turn it around and start contacting the providers to ask them if they will add support for certain features to match (or beat) their competitors. I think there&#8217;s real potential for communicating back to the shared hosting providers that there&#8217;s a large market for modern Perl hosting, and ideally, what features we need/want. The site may also be useful for feeding back to the Perl toolchain/framework people what rough edges people are running into in shared environments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/serve-up-dancer-webapps-for-six-bucks/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WebGUI Articles</title>
		<link>http://blog.patspam.com/2010/webgui-articles</link>
		<comments>http://blog.patspam.com/2010/webgui-articles#comments</comments>
		<pubDate>Thu, 13 May 2010 00:20:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1364</guid>
		<description><![CDATA[Speaking of articles, I finally got around to documenting two of the larger systems I designed for WebGUI (the Perl CMS) last year: FilePump &#8211; speeds up your front-end performance by maximising your YSlow score Passive Analytics &#8211; a system for analysing website usage data These features are both now part of the WebGUI core.]]></description>
			<content:encoded><![CDATA[<p>Speaking of articles, I finally got around to documenting two of the larger systems I designed for <a href="http://webgui.org">WebGUI</a> (the Perl CMS) last year:</p>
<ul>
<li><a href="http://www.webgui.org/wiki/FilePump">FilePump</a> &#8211; speeds up your front-end performance by maximising your <a href="http://developer.yahoo.com/yslow/">YSlow</a> score</li>
<li><a href="http://www.webgui.org/wiki/passive-analytics">Passive Analytics</a> &#8211; a system for analysing website usage data</li>
</ul>
<p>These features are both now part of the WebGUI core.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/webgui-articles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shout-out to the translators</title>
		<link>http://blog.patspam.com/2010/shout-out-to-the-translators</link>
		<comments>http://blog.patspam.com/2010/shout-out-to-the-translators#comments</comments>
		<pubDate>Wed, 12 May 2010 19:10:10 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1362</guid>
		<description><![CDATA[This morning I had an email from someone in the ExtJS community letting me know that they&#8217;d translated my Extending Ext Components article into German. I had a look and all of my ExtJS articles have been translated into at least one other language. My record is Playing With ExtJS The Easy Way which has [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I had an email from someone in the ExtJS community letting me know that they&#8217;d translated my <a href="http://www.extjs.com/learn/Manual:Component:Extending_Ext_Components">Extending Ext Components</a> article into German. I had a look and <a href="http://www.extjs.com/learn/Manual:RESTful_Web_Services">all</a> <a href="http://www.extjs.com/learn/Manual:Ext_Source_Overview">of</a> <a href="http://www.extjs.com/learn/Manual:Intro:Patterns:Flyweight">my</a> <a href="http://www.extjs.com/learn/Manual:Intro:Inheritance">ExtJS</a> <a href="http://www.extjs.com/learn/Manual:Core:Working_with_JSON">articles</a> <a href="http://www.extjs.com/learn/Tutorial:Playing_With_Ext_The_Easy_Way">have</a> been translated into at least one other language. My record is <a href="http://www.extjs.com/learn/Tutorial:Playing_With_Ext_The_Easy_Way">Playing With ExtJS The Easy Way</a> which has been translated into 10 different languages: Deutsch, Chinese,  Korean,  Japanese, French, Russian, Spanish, Turkish, Portuguese and Hungarian. Page views of the English versions of these articles are just about to tick over the 500,000 mark.</p>
<p>Recently <a href="http://search.cpan.org/perldoc?Padre::Plugin::Plack">Padre::Plugin::Plack</a>, my <a href="http://plackperl.org">Plack</a> (the Perl Web Server) plugin for <a href="http://padre.perlide.org/">Padre</a> (the Perl IDE) was translated into Dutch, Brazilian Portuguese and French.</p>
<p>I always get such a buzz when I find out that something I&#8217;ve worked on has been translated into another language. It sends a clear message that someone found your work useful enough to go to the effort of translating it so that a new community of people could use it. That&#8217;s an awesome form of positive feedback, and a great motivator for being involved in open source software.</p>
<p>Thanks translators!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/shout-out-to-the-translators/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plack Middleware for your iPhone</title>
		<link>http://blog.patspam.com/2010/plack-middleware-for-your-iphone</link>
		<comments>http://blog.patspam.com/2010/plack-middleware-for-your-iphone#comments</comments>
		<pubDate>Tue, 23 Mar 2010 17:02:25 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Comp]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1341</guid>
		<description><![CDATA[I started playing with HTML5 iPhone apps this week, and as a result there is a new piece of Plack middleware sitting on CPAN called Plack::Middleware::iPhone. It&#8217;s a (borderline ACME) module that rewrites html on the fly to make it play nicer with iPhones. Here&#8217;s a silly example: # A Perl one-liner for the iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>I started playing with <a href="http://www.quirksmode.org/blog/archives/2010/03/html5_apps.html">HTML5 iPhone apps</a> this week, and as a result there is a new piece of <a href="http://plackperl.org">Plack</a> middleware sitting on CPAN called <a href="http://search.cpan.org/perldoc?Plack::Middleware::iPhone">Plack::Middleware::iPhone</a>. It&#8217;s a (borderline ACME) module that rewrites html on the fly to make it play nicer with iPhones.</p>
<p>Here&#8217;s a silly example:</p>
<pre class="brush: bash;">

# A Perl one-liner for the iPhone generation
plackup -MPlack::App::Directory -e 'builder {enable iPhone; Plack::App::Directory-&gt;new}'
</pre>
<p>That makes your current directory browsable as a web app, with some special iPhone meta tags injected so that the viewport is appropriately resized &amp; fullscreen mode is enabled when you launch your &#8220;app&#8221; from your Home Screen.</p>
<p>Here&#8217;s a slightly more usable one &#8211; your own personal mobile.search.cpan.org:</p>
<pre class="brush: bash;">

plackup -MPlack::App::Proxy -e 'builder {enable iPhone; Plack::App::Proxy-&gt;new(remote =&gt; &quot;http://search.cpan.org/&quot;) }'
</pre>
<p>You can customise things too:</p>
<pre class="brush: perl;">
# app.psgi
use Plack::Builder;
use Plack::App::Proxy;
builder {
    enable &quot;iPhone&quot;,
        statusbar =&gt; 'black-translucent', # transparent status bar
        startup_image =&gt; 'loading.png', # displayed as the app loads
        icon =&gt; 'icon.png'; # cutom app shortcut icon
    Plack::App::Proxy-&gt;new(remote =&gt; &quot;http://search.cpan.org/&quot;);
};
</pre>
<p>Here&#8217;s an actual app that I have running on my phone to display the New York subway map (images courtesy of the <a href="http://www.mta.info/nyct/maps/submap.htm">MTA</a> website):</p>
<pre class="brush: xml;">
&lt;!-- index.html --&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;NYC Map&lt;/title&gt;
        &lt;style&gt;
            body, img { margin: 0; padding: 0; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;script&gt;
            window.scrollTo(300, 700); // Initially zoom in on my local area
        &lt;/script&gt;
        &lt;img src=&quot;sub1a.gif&quot;&gt;
        &lt;img src=&quot;sub2a.gif&quot;&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<pre class="brush: perl;">
# app.psgi
use Plack::App::Directory;
builder {
    enable &quot;iPhone&quot;,
        icon =&gt; 'icon.png',
        manifest =&gt; 1,
        viewport =&gt; 'initial-scale = 1, maximum-scale = 1.5, width = device-width',
        statusbar =&gt; 'black-translucent',
        startup_image =&gt; 'loading.png';
    Plack::App::Directory-&gt;new;
};
</pre>
<p>Use plackup to run the site on your local network, connect via Safari on your iPhone (via wifi) and then use the &#8220;Add to Home Screen&#8221; option to add an app shortcut to it on your phone. Your 57&#215;57 icon.png image will be used as the app icon, and your 320&#215;460 loading image will appear as the app loads. The viewport string sets the initial zoom scale and limits how far in the user can zoom. Nice and shiny.</p>
<p>With the <strong>manifest </strong>option enabled, <a href="http://search.cpan.org/perldoc?Plack::Middleware::iPhone">Plack::Middleware::iPhone</a> automatically generates a manifest file and injects the appropriate html to enable <a href="http://www.w3.org/TR/offline-webapps/">HTML5 offline web app caching</a> on your iPhone. This means that your app keeps working once you Ctrl-C the plackup server and walk out your front door. And it keeps on working when you&#8217;re stuck in the New York subway system without phone reception, trying to figure out what train you&#8217;re supposed to catch to get home.</p>
<p>If you&#8217;ve just started exploring how to build iPhone apps with web technologies, I suggest you check out Jonathan Stark&#8217;s book &#8220;Building iPhone Apps with HTML, CSS, and JavaScript&#8221; (online <a href="http://building-iphone-apps.labs.oreilly.com">here</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/plack-middleware-for-your-iphone/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PerlSharedHosting</title>
		<link>http://blog.patspam.com/2010/perlsharedhosting</link>
		<comments>http://blog.patspam.com/2010/perlsharedhosting#comments</comments>
		<pubDate>Mon, 08 Mar 2010 01:23:45 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Comp]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1327</guid>
		<description><![CDATA[Latest Web::Simple master (git://git.shadowcat.co.uk/catagits/Web-Simple.git) is now using Plack, the perl web server directly for CGI and FastCGI and I hope do do another release shortly with notes on deploying as both on shared hosts (more specifically Dreamhost but with an invitation to bitch if they don&#8217;t work on other budget hosts). mst,  &#8221;Oh Subdispatch, Oh Subdispatch&#8220; Every [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Latest Web::Simple master (git://git.shadowcat.co.uk/catagits/Web-Simple.git) is now using <a href="http://plackperl.org/">Plack, the perl web server</a> directly for CGI and FastCGI and I hope do do another release shortly with notes on deploying as both on shared hosts (more specifically <a href="http://www.dreamhost.com/">Dreamhost</a> but with an invitation to bitch if they don&#8217;t work on other budget hosts).</p>
<p style="text-align: right;">mst,  &#8221;<a href="http://www.shadowcat.co.uk/blog/matt-s-trout/oh-subdispatch-oh-subdispatch/">Oh Subdispatch, Oh Subdispatch</a>&#8220;</p>
</blockquote>
<p style="text-align: left;">Every time someone mentions a cool new web framework like <a href="http://search.cpan.org/perldoc?Web::Simple">Web::Simple</a>, <a href="http://perldancer.org/">Dancer</a> or <a href="http://search.cpan.org/perldoc?Tatsumaki">Tatsumaki</a>, my immediate reaction is to start thinking up cool little niche web apps I could build with it. You know, the kind you imagine yourself whipping up during your lunch break, that will probably never get more than 10 curious users but just might turn into the next big thing if only you got it up and running on a public server. And that&#8217;s when the second thought immediately arrives: where am I going to run this thing? Do I really think the idea has enough legs to justify paying for a virtual server plan? Can I be bothered going through the pain of figuring out how to deploy it on a shared hosting provider? And normally that&#8217;s the point where I sigh wistfully and go back to reading my RSS feeds.</p>
<p style="text-align: left;">The thing is, with the advent of things like <a href="http://search.cpan.org/perldoc?local::lib">local::lib</a> it&#8217;s getting a lot easier to deploy Perl web apps on shared hosting. And with most web frameworks adopting <a href="http://plackperl.org/">Plack/PSGI</a>, the work required to deploy Perl web apps on budget hosts is converging into a similar sequence of steps.</p>
<p style="text-align: left;">So this time during my lunch break I started envisaging a centralised, SEO-friendly information source (hello <a href="http://perlsharedhosting.com">perlsharedhosting.com</a>) that cobbles together all of the currently available information into an easy to digest form to make it ridiculously easy to choose a shared hosting provider, deploy your web app and troubleshoot common problems.</p>
<p style="text-align: left;">A site that works like this:</p>
<ul>
<li>The front page contains a list of Perl-friendly hosting providers, with a meta-score based on how many features they support (+) and how many unresolved issues they have (-), and maybe user review scores thrown into the mix too</li>
<li>Each hosting provider has a page of its own, listing in full which features are supported (used to compute the meta-score). Users can post comments on each of these pages, to leave testimonials (&#8220;I am currently running a Web::Simple site that gets x hits per hour on this host&#8221;) and note unresolved issues (&#8220;module X::Y fails to install on this host&#8221;). As issues get solved these become tips.</li>
<li>Each technology/feature/technique also gets a page of its own, with links to the official man pages, shared-hosting specific notes and again user comments
<ul>
<li>dependency related: <a href="http://search.cpan.org/perldoc?local::lib">local::lib</a>, cpan, <a href="http://search.cpan.org/perldoc?App::cpanminus">cpanm</a>, ..</li>
<li>environment related: locating and running perl, paths, daemons, viewing error output, ..</li>
<li>web deployment related: CGI, FastCGI, ..</li>
<li>framework / web app related: <a href="http://search.cpan.org/perldoc?Web::Simple">Web::Simple</a>, <a href="http://perldancer.org/">Dancer</a>, <a href="http://mojomojo.org/">MojoMojo</a>, <a href="http://www.catalystframework.org/">Catalyst</a>, <a href="http://search.cpan.org/perldoc?Tatsumaki">Tatsumaki</a>, ..</li>
</ul>
</li>
</ul>
<p>I haven&#8217;t decided yet what engine would fit best.. <a href="http://mojomojo.org/">MojoMojo</a> is a front-runner, and in fact the <a href="http://wiki.catalystframework.org/wiki/hosting">Catalyst Friendly Hosting</a> page runs on <a href="http://mojomojo.org/">MojoMojo</a> does a large chunk of what I&#8217;ve described above.</p>
<p>The site would be very &#8220;cookbook&#8221; oriented, since we&#8217;re specifically targeting people who can&#8217;t be bothered learning the ins and outs of 10 different technologies (not to mention figuring out how to get them to play nicely together) for the sake of deploying toy web applications on cheap shared hosting. Just the essentials: this is what you need, this is how you achieve it. And if you want to learn more, go here.</p>
<p>With that in place, we&#8217;d end up with a single, visible, place to research and document the complications of running Perl web apps on shared hosting. And if the site became popular, hosting providers might even take notice and start offering more Perl-friendly shared environments. We could have live demo pages running on different hosts, possibly even donated by hosting providers if they see it as a way of showcasing their Perl-friendliness (mojomojo.dreamhost.perlsharedhosting.com, dancer.resellerzoom.perlsharedhosting.com, etc..).</p>
<p>I got as far as registering the <a href="http://perlsharedhosting.com">domain name</a>; I was planning on getting a simple <a href="http://mojomojo.org/">MojoMojo</a> prototype up and running, but I got side-tracked researching how to deploy it on my shared hosting account&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2010/perlsharedhosting/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Padre::Plugin::Plack</title>
		<link>http://blog.patspam.com/2009/padrepluginplack</link>
		<comments>http://blog.patspam.com/2009/padrepluginplack#comments</comments>
		<pubDate>Wed, 23 Dec 2009 15:22:42 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Comp]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1301</guid>
		<description><![CDATA[In conjunction with today&#8217;s Christmas release of Padre, I&#8217;d like to announce my latest Padre plugin: Padre::Plugin::Plack. As the name suggests, Padre::Plugin::Plack adds Plack awareness to Padre. With the plugin installed, opening *.psgi files causes some special things to happen. PSGI files are really just ordinary Perl files, so Padre does its normal Perl lexing/syntax highlighting [...]]]></description>
			<content:encoded><![CDATA[<p>In conjunction with today&#8217;s <a href="http://mail.perlide.org/pipermail/padre-dev/2009-December/001451.html">Christmas release</a> of <a href="http://padre.perlide.org">Padre</a>, I&#8217;d like to announce my latest Padre plugin: <a href="http://search.cpan.org/search?query=Padre::Plugin::Plack">Padre::Plugin::Plack</a>.</p>
<p>As the name suggests, Padre::Plugin::Plack adds <a href="http://plackperl.org">Plack</a> awareness to Padre. With the plugin installed, opening *.psgi files causes some special things to happen. PSGI files are really just ordinary Perl files, so Padre does its normal Perl lexing/syntax highlighting magic on them, but the real fun starts with the Plack-specific features that appear in the per-file graphical <a href="http://search.cpan.org/search?query=plackup">plackup</a> control panel that shows up. The panel lets you run your web app in a Plack server at the click of a button, view server output, configure plackup options and launch a web browser on the appropriate port.</p>
<div><a href="http://blog.patspam.com/wp-content/uploads/2009/12/1.png"><img class="aligncenter size-medium wp-image-1304" title="Padre::Plugin::Plack panel" src="http://blog.patspam.com/wp-content/uploads/2009/12/1-300x142.png" alt="" width="300" height="142" /></a></div>
<p>The great thing about Plack/<a href="http://search.cpan.org/search?query=psgi">PSGI</a> is that unlike my <a href="http://blog.patspam.com/2009/padrepluginwebgui">previous</a> plugin (<a href="http://search.cpan.org/search?query=Padre::Plugin::WebGUI">Padre::Plugin::WebGUI</a>) which was specific to a single web app (albeit a <a href="http://webgui.org">big one</a>), this plugin can be used for any web app built in a <a href="http://plackperl.org/#frameworks">web framework that supports Plack</a> (<a href="http://www.catalystframework.org/">Catalyst</a>, <a href="http://cgi-app.org/">CGI::Application</a>, <a href="http://search.cpan.org/dist/HTTP-Engine">HTTP::Engine</a>, etc..). This potential for cross-framework application is one of the motivating factors that makes developing Plack modules (<a href="http://plackperl.org/#middlewares">Middleware</a> etc..) so much fun.</p>
<p>The plugin turns on plackup&#8217;s &#8220;&#8211;reload&#8221; option by default, which conveniently causes the plack server to reload every time you modify your source files in Padre. This makes for quite a nice, if somewhat minimal &#8220;Plack IDE&#8221; experience (this is version 0.01 after all).</p>
<p>The plugin integrates all of the Plack example &#8220;dot-psgi&#8221; files as templates that can be used to create different types of Plack apps straight from the GUI menu.</p>
<div><a href="http://blog.patspam.com/wp-content/uploads/2009/12/2.png"><img class="aligncenter size-medium wp-image-1305" title="Padre::Plugin::Plack new file templates" src="http://blog.patspam.com/wp-content/uploads/2009/12/2-300x214.png" alt="" width="300" height="214" /></a></div>
<p>The pre-populated list of Plack servers and the simple start/stop button makes for a nice way of exploring the Plack server ecosystem. You can use the other panel options to enter a specific port to run on, toggle auto-start mode and pass additional options to plackup (options that start with &#8220;&#8211;&#8221; are passed through to the backend server).</p>
<div><a href="http://blog.patspam.com/wp-content/uploads/2009/12/3.png"><img class="aligncenter size-medium wp-image-1306" title="Padre::Plugin::Plack server options" src="http://blog.patspam.com/wp-content/uploads/2009/12/3-300x227.png" alt="" width="300" height="227" /></a></div>
<p>The output panel is similar to the output panel that Padre normally displays when you execute Perl files, except that you get one panel per .psgi file meaning that you can run multiple plack servers simultaneously and independently view their output. The appropriate panel is automatically selected when you click on the corresponding file tab, and running processes are stopped when you close the tab.</p>
<p>It should be really easy to turn Padre::Plugin::Plack into new plugins that involve the same basic ingredients, namely  a file extension and an external command for running those files, with a per-file panel for command options and output. So I encourage anyone who has a similar plugin in mind to steal liberally from Padre::Plugin::Plack (as I did from Padre::Plugin::Catalyst &#8211; thanks garu++). Ruby Rack support comes to mind as a trivial example.</p>
<p>Make Padre your domain-specific IDE today <img src='http://blog.patspam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2009/padrepluginplack/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plack helps with Javascript development too</title>
		<link>http://blog.patspam.com/2009/plack-helps-with-javascript-development-too</link>
		<comments>http://blog.patspam.com/2009/plack-helps-with-javascript-development-too#comments</comments>
		<pubDate>Fri, 18 Dec 2009 19:23:36 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Comp]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.patspam.com/?p=1291</guid>
		<description><![CDATA[Today I was debugging a Javascript bug in ExtJS + AIR, and I wanted to check rendering in another browser. I created a static html file with the minimal javascript test case embedded in it, but then realised that I needed to load in the ExtJS files from somewhere. With other JS libraries you can [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was debugging a Javascript bug in ExtJS + AIR, and I wanted to check rendering in another browser. I created a static html file with the minimal javascript test case embedded in it, but then realised that I needed to load in the ExtJS files from somewhere. With other JS libraries you can use <a href="http://code.google.com/apis/ajaxlibs/">freely available CDNs</a> for this sort of thing, but because ExtJS has funky ideas about licensing, this isn&#8217;t an option. What I needed was a quick and easy way to serve up the ExtJS files, which were sitting in a folder on my computer, over http. This sort of thing happens frequently with custom code too, when you attempt to create a static (minimal test case) version of a live site.</p>
<p>Plack has a really neat solution to this problem.</p>
<p>Following a tip from <a href="http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html">day #5 of Miyagawa&#8217;s Plack advent calendar</a>, serving up the current directory over http is as simple as this Perl one-liner:</p>
<pre class="brush: bash;">

$ plackup -MPlack::App::Directory -e 'Plack::App::Directory-&gt;new

Plack::Server::Standalone: Accepting connections at http://0:5000/
</pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 91px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$ plackup -MPlack::App::Directory -e &#8216;Plack::App::Directory-&gt;new&#8217;Plack::Server::Standalone: Accepting connections at http://0:5000/$ plackup -MPlack::App::Directory -e &#8216;Plack::App::Directory-&gt;new&#8217;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 91px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Plack::Server::Standalone: Accepting connections at http://0:5000/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 91px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># Or if you need the files over port 80:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 91px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$ sudo plackup -MPlack::App::Directory -e &#8216;Plack::App::Directory-&gt;new&#8217; -p 80</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 91px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Plack::Server::Standalone: Accepting connections at http://0:80/</div>
<p>Or if you need the files served over port 80:</p>
<pre class="brush: bash;">

$ sudo plackup -MPlack::App::Directory -e 'Plack::App::Directory-&gt;new' -p 80

Plack::Server::Standalone: Accepting connections at http://0:80/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.patspam.com/2009/plack-helps-with-javascript-development-too/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
