Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am powerman on github.
  • I am powerman (https://keybase.io/powerman) on keybase.
  • I have a public key ASCSBOCcVZFOBR0em9fFkAAWPJX7QbEQq69BY9wDKS_n2Qo

To claim this, I am signing this object:

@powerman
powerman / AsciidocCheatsheet.adoc
Last active June 24, 2025 11:30
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

@powerman
powerman / gist:5468849
Created April 26, 2013 17:24
Using AnyEvent::DBI::MySQL with Mojolicious.
use AnyEvent::DBI::MySQL;
sub startup {
my $app = shift;
$app->config(db => {dsn=>…, login=>…, pass=>…});
$app->helper(dbh => sub { shift->{dbh} });
$app->helper(new_dbh => sub {
state $db = shift->app->config('db') or return;
@powerman
powerman / gist:5456484
Last active December 16, 2015 15:29
Support for non-blocking Mojolicious app in CGI mode
use AnyEvent;
sub allow_non_blocking_cgi {
my ($module) = @_;
eval "require $module;" or die $@; ## no critic (ProhibitStringyEval)
my $startup = \&{$module.'::startup'};
my $wrapper = sub {
my ($app) = @_;
&{$startup};
my $done = AnyEvent->condvar;