No time to wait http://showmetheco.de/index.rss Just code Twist 0.1 How to avoid Unicode pitfalls in Mojolicious http://showmetheco.de/articles/2010/10/how-to-avoid-unicode-pitfalls-in-mojolicious.html Unicode is hard. Unicode in Perl is even harder, because sometimes Perl is just too smart. While Mojolicious is a web framework, no wonder why it should support Unicode really well. But even if Mojolicious tries hard to make things easy for a developer, one must really understand what's going on behind the scene.

Keep reading ]]>
perl mojolicious unicode Wed, 27 Oct 2010 21:09:00 GMT http://showmetheco.de/articles/2010/10/how-to-avoid-unicode-pitfalls-in-mojolicious.html
More Mojolicious WebSocket examples http://showmetheco.de/articles/2010/5/more-mojolicious-websocket-examples.html I've been playing with WebSockets for a while. And here are some links to the projects I've came up with. Server side is written in Mojolicious::Lite. Client side is mostly JQuery. For non websocket browser Flash workaround is used.

Showmetheshell

An interactive shell with colors and unicode support.

http://github.com/vti/showmetheshell

Some screenshots are available in the repo:

http://github.com/vti/showmetheshell/tree/master/screenshots

Showmethedesktop

A HTML5 Canvas VNC client.

http://github.com/vti/showmethedesktop

When implementing this I've also written a Protocol::RFB module. That does the job.

http://github.com/vti/protocol-rfb

Showmethedrawing

A HTML5 Canvas simple colaboration drawing.

http://github.com/vti/showmethedrawing

Mojomber

A simple multiplayer Bomberman clone. Fun to play :)

http://github.com/vti/mojomber

And BTW, Mojo::JSON::Any speeds up everything.

Enough self advertising for today ;)

]]>
html5 websocket perl mojolicious Sun, 16 May 2010 21:41:00 GMT http://showmetheco.de/articles/2010/5/more-mojolicious-websocket-examples.html
Mojolicious, Nginx and FastCGI http://showmetheco.de/articles/2010/4/mojolicious-nginx-and-fastcgi.html To use Mojolicious under nginx you should first install Mojo::Server::FCGI. We are going to use fcgi_prefork server, since we need a manager. Nginx configuration file needs a couple tweaks. Here is a config:

    server {
        listen   80; 

        server_name  example.com;

        access_log  /var/log/nginx/example.com/access.log;

        location / { 
            root /var/www/nginx/example.com;

            # Our Mojolicious app runs on this address
            fastcgi_pass   127.0.0.1:3000;

            # Default fastcgi parameters
            include /etc/nginx/fastcgi_params;

            # Fixes
            fastcgi_param  PATH_INFO          $fastcgi_script_name;
        }   
    }

Then run your Mojolicious application as:

    $ perl my_app fcgi_prefork
    Server available at :3000.

Start nginx. Enjoy.

]]>
mojolicious nginx fastcgi fcgi Mon, 19 Apr 2010 13:57:00 GMT http://showmetheco.de/articles/2010/4/mojolicious-nginx-and-fastcgi.html
Mojolicious JsonConfig plugin http://showmetheco.de/articles/2010/1/mojolicious-json-config-plugin.html So now the JSON configuration that i used in Bootylicious and Pastelicious http://github.com/vti/pastelicious is available as Mojolicious plugin and was added by Sebastian Riedel to the core Mojo code. The source code is available at github http://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/JsonConfig.pm.

Keep reading ]]>
mojo mojolicious perl plugin Sat, 16 Jan 2010 10:35:00 GMT http://showmetheco.de/articles/2010/1/mojolicious-json-config-plugin.html