Skip to content

Instantly share code, notes, and snippets.

@akiym
akiym / markdown.pl
Created March 31, 2011 15:07
preview Markdown in real-time.
use Mojolicious::Lite;
use Text::Markdown qw/markdown/;
get '/' => sub {
my $self = shift;
$self->render('index');
};
get '/markdown' => sub {
my $self = shift;
@akiym
akiym / _cpanm
Created March 31, 2011 05:54
zsh autcompletion for plackup / cpanm / dzil
#compdef cpanm
#autoload
typeset -A opt_args
local context state line
_arguments -C \
'(-h)'{-h,--help}'[prints help]' \
'(-v --verobse)'{-v,--verbose}'[turn on chatty output.]' \
'(-q --quiet)'{-q,--quiet}'[turn off the most output.]' \
@akiym
akiym / gist:794857
Created January 25, 2011 12:28
Furl
use strict;
use warnings;
use Furl;
use LWP::UserAgent;
my $url = 'http://blog.livedoor.jp/dqnplus/';
{
my $furl = Furl->new;
my $res = $furl->get($url);
@akiym
akiym / gist:525295
Created August 15, 2010 09:37
Gyazo
#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojo::Asset::File;
use Digest::MD5 qw(md5_hex);
use File::Spec;
use IO::File;
my $dir = app->home->rel_dir('images');