Acme-CPANModulesBundle-Import-MojoliciousAdvent-2017
view release on metacpan or search on metacpan
devdata/https_mojolicious.io_blog_2017_12_16_day-16-the-secret-life-of-sessions view on Meta::CPAN
<pre><code>$ perl myapp.pl daemon
</code></pre>
<p>use the <code>hypnotoad</code> script</p>
<pre><code>$ hypnotoad myapp.pl
</code></pre>
<p>The application should again be available on port <code>3000</code>.</p>
<p>You'll see that rather than staying in the foreground like with <code>daemon</code> the command returns and you get your prompt back.
Don't worry, as long as it said that it started it should stay running.
To stop the application, run the same commmand but also pass a <code>-s</code> switch</p>
<pre><code>$ hypnotoad -s myapp.pl
</code></pre>
<p>The really interesting thing happens when restarting a running application.
Say you've rolled your secrets and want to restart the application to use it.
Simply run the command as before, just like when you started it up.</p>
devdata/https_mojolicious.io_blog_2017_12_21_day-21-virtually-a-lumberjack view on Meta::CPAN
action shortly so, in half of the wait time, we start a new file.
This should mean that the end and start of each file, the HMD is not moving
(much).</p>
<p>Then we need to start walking through this script by adding this before
starting the event loop in <em>main</em>:</p>
<pre><code>$self->loop->timer(0 => sub { $self->instruction_show });
</code></pre>
<p>Running this now prompts the user to move the HMD while outputting the packet
data in an image named after the movement that image represents!</p>
<h2>Get Your Head(er) Checked</h2>
<p>As mentioned, the PGM header is broken as it is supposed to contain the number
of rows and columns in the image, but this isn't known in advance.
We put an 8 character per value placeholder there and use this small shell
script to fix it up:</p>
<pre><code>#!/bin/sh
( run in 1.122 second using v1.01-cache-2.11-cpan-6aa56a78535 )