Tue, 08 Jun 2010
Today,
8th of June,
was the setup day before LinuxTag 2010.
I am really excited since I've never taken a part in a such big open source event.
It's a privilege to be able to talk about Mojolicious there :)
Here are some photos from the setup day.
http://picasaweb.google.com/109117812087018133975/LinuxTag2010SetupDay?feat=directlink#
Sun, 16 May 2010
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 ;)
Sun, 02 May 2010
For a long time there was the MojoX::Locale::Maketext module.
But it is currently deprecated since Mojolicious has Mojolicious::Plugin::I18n in its core.
Today we will try to use it to create a multilingual website.
Tue, 27 Apr 2010
While there is always Mojo::JSON out there,
sometimes we need more speed.
JSON::XS is the first thing that comes to mind.
But they not only have different interfaces,
but also work different with encodings.
Mon, 19 Apr 2010
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.
Sun, 18 Apr 2010
So here is my first attempt to try this new awesome WebSocket technology.
And since Mojolicious is already compatible I couldn't wait too long.
Sun, 14 Feb 2010
After writing Text::Haml which is a Haml implementation in Perl the next logical step was to write a renderer for Mojolicious.
So here it is http://github.com/vti/mojox-renderer-haml.
Besides a renderer itself there is also a Mojolicious::Plugin::HamlRenderer module that makes it really easy to plug in a new template handler.
# Load HAML renderer
$self->plugin('haml_renderer');
And then you can write a new template template.html.haml in Haml:
!!!
%html
%body
#main
%h2 Hello, world!
And you will get:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<div id='main'>
<h2>Hello, world!</h2>
</div>
</body>
</html>
Fri, 05 Feb 2010
I don't really know how to program in JavaScript and that's why I chose JQuery to do all the job with AJAX.
Let's see how short and easy the solution in Mojolicious::Lite could be.
Sun, 31 Jan 2010
After experimenting with Redis in Mojo (http://github.com/vti/mojox-socket_stream) I wanted to do something asynchronously with DBI also,
using my another Async::ORM module.
But apparently doing async with DBI is not that easy.
By itself DBI blocks everything and thus there are a few workarounds on CPAN with forks,
sockets and pipes like AnyEvent::DBI,
POE::Component::EasyDBI,
POE::Component::SimpleDBI,
IO::Lambda::DBI and others.
That is why I have AnyEvent::DBI driver inside of Async::ORM.
But I wanted to use Mojo::IOLoop as an event loop.
Writing another forking hack module is cool but I am not that smart,
that's why I googled with a hope to find some event loop independent async DBI.
And I found dbslayer (http://code.nytimes.com/projects/dbslayer/wiki).
DBSlayer is a proxy between HTTP+JSON and MySQL.
You send your SQL query as a GET request in JSON format and get JSON response.
So what I needed is a http client that can send json requests and parse json responses.
Mojo has got both.
Sat, 23 Jan 2010
I keep working on async framework agnostic Protocol::OpenID (http://github.com/vti/protocol-open) Perl module,
and just finished OpenID associations.
It is always nice to have some real life tests,
and with Mojo it is fun and easy.