Skip to content

Instantly share code, notes, and snippets.

View hinrik's full-sized avatar

Hinrik Örn Sigurðsson hinrik

View GitHub Profile
@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.2"
\header {
title = "Destiny"
subtitle = \markup { "from" \italic "Lost" }
composer = "Michael Giacchino"
instrument = "Piano solo"
}
\score {
$ 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?
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';
use strict;
use warnings;
use POE;
use Test::More tests => 1;
POE::Session->create(
package_states => [
(__PACKAGE__) => [qw(
_start
exit
#!/usr/bin/env perl
# vim: ts=2 sw=2 filetype=perl expandtab
use strict;
use warnings;
use Test::More;
use POE qw(Wheel::Run);
plan tests => 1;
From 780e2410506ecd78b43c71ee2d2bbbc2a37184ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= <[email protected]>
Date: Tue, 22 Jun 2010 18:53:42 +0000
Subject: [PATCH] Fix child exit problems
A typo was plaguing the Program => ARRAY form.
Wrap the Program => CODE form in an eval. Otherwise, code that die()s
will not exit cleanly.
---
@hinrik
hinrik / flac2mp3
Created June 2, 2010 00:21
Encode FLAC files into properly tagged MP3 files
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec::Functions qw(catfile splitpath);
use File::Which;
use Getopt::Long qw(:config auto_help);
use List::Util qw(first);
use Pod::Usage;
use String::ShellQuote;
From 28e984dbb1ad6f47e419414d07b298b97c022d07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= <[email protected]>
Date: Thu, 20 May 2010 15:25:18 +0000
Subject: [PATCH] Support a user-supplied authorization sub for commands
---
Changes | 1 +
lib/POE/Component/IRC/Plugin/BotCommand.pm | 31 ++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)
use strict;
use warnings;
use lib 't/inc';
use POE qw(Wheel::SocketFactory);
use Socket;
use POE::Component::IRC;
use POE::Component::Server::IRC;
use Test::More tests => 4;
my $bot1 = POE::Component::IRC->spawn(