Skip to content

Instantly share code, notes, and snippets.

View ohoushyar's full-sized avatar

Omid Houshyar ohoushyar

View GitHub Profile
#!/usr/bin/env perl
use Mojolicious::Lite;
use Mango;
use Mango::BSON 'bson_oid';
helper mango => sub { state $mango = Mango->new($ENV{PASTEDB}) };
helper pastes => sub { shift->mango->db->collection('pastes') };
get '/' => 'submit';
@jrockway
jrockway / event.pl
Created June 9, 2009 13:40
event vs. non-event approach for writing to a child
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use AnyEvent;
use AnyEvent::Handle;
open my $fd, '|-', 'perl -ne "sleep 1; print"' or die $!;