Skip to content

Instantly share code, notes, and snippets.

View hinrik's full-sized avatar

Hinrik Örn Sigurðsson hinrik

View GitHub Profile
diff --git a/lib/POE/Quickie.pm b/lib/POE/Quickie.pm
index 9ea4307..6f67550 100644
--- a/lib/POE/Quickie.pm
+++ b/lib/POE/Quickie.pm
@@ -266,11 +266,16 @@ POE::Quickie - A lazy way to wrap blocking programs
=head1 SYNOPSIS
- use POE::Quickie;
+ use POE::Quickie 'quickie';
$ perl -e'$SIG{INT} = sub { warn "foo\n" }; sleep 30'
^Cfoo
$ perl -e'$SIG{INT} = sub { warn "foo\n" }; require Net::DNS; sleep 30'
^CSignal SIGINT received, but no signal handler set.
The above was on Perl 5.13.2. It works fine on 5.10.1 with the same version of Net::DNS (0.66). Also, after greping through Net::DNS's source, it doesn't look like it ever modifies $SIG{INT}. Possible Perl bug?
\version "2.12.2"
\header {
title = "Destiny"
subtitle = \markup { "from" \italic "Lost" }
composer = "Michael Giacchino"
instrument = "Piano solo"
}
\score {
@hinrik
hinrik / gist:842589
Created February 24, 2011 18:13
foo.sh
alias alj="rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ \
-y 'aljazeera_en_veryhigh?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=' \
-W 'http://admin.brightcove.com/viewer/us1.24.04.08.2011-01-14072625/federatedVideoUI/BrightcovePlayer.swf \
-p 'http://english.aljazeera.net/watch_now/ \
-a 'aljazeeraflashlive-live?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=' \
| mplayer -"
\version "2.12.3"
\score {
\new PianoStaff <<
\new Staff {
\relative c'' {
a4 b c d
<<
{ <c e g>1 }
\\
\version "2.12.3"
foo = {
\relative c' {
<<
{
e8-1 b e b e b e b
d-1 b d b d b d b
d-1 b d b d b d b
d-1 a d a d a d a
#!/usr/bin/env perl
use strict;
use warnings;
use POE;
use POE::Wheel::ReadLine;
use POE::Wheel::Run;
use POE::Wheel::ReadWrite;
use Symbol 'gensym';
use Test::More tests => 4;
@hinrik
hinrik / 02_success.t
Created May 19, 2011 02:42
SIGCHLD sometimes not delivered. Race condition?
use strict;
use warnings FATAL => 'all';
use POE;
use POE::Quickie;
use Test::More tests => 5;
POE::Session->create(
package_states => [
(__PACKAGE__) => [qw(
_start
package NicelandYouTube;
use strict;
use warnings FATAL => 'all';
use List::MoreUtils 'any';
use POE::Component::IRC::Plugin 'PCI_EAT_NONE';
use POE::Component::IRC::Plugin::URI::Find;
use POE::Quickie;
sub new {
use strict;
use warnings FATAL => 'all';
use POE;
use Test::More tests => 2;
{
package WheelWrapper;
use strict;
use warnings FATAL => 'all';