Skip to content

Instantly share code, notes, and snippets.

use Plack::Builder;
my $old_app = sub {
return sub {
my $respond = shift;
$respond->([200, [], ['success']]);
}
};
sub delayed_auth {
arthur:Downloads lee$ curl -L http://cpanmin.us | perl - --self-upgrade
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 167k 100 167k 0 0 152k 0 0:00:01 0:00:01 --:--:-- 152k
Can't locate object method "new" via package "Module::Metadata::Version" (perhaps you forgot to load "Module::Metadata::Version"?) at /loader/0x10083b350/App/cpanminus/script.pm line 950.
get "/{tweet:[0-9]+}" => sub {
my ($req, $res) = @_;
my $id = $req->captures->{tweet};
$ua->get("statuses/show/$id", sub {
my ($hdr, $tweet, $reason) = @_;
$res->send("<pre>".Dumper($tweet)."</pre>");
});
};
sub invite {
my ($self, $cl, $msg) = @_;
my (undef, $from, $channel) = @{$msg->{params}};
utf8::decode($_) for ($from, $channel);
$self->broadcast({
type => "action",
event => "announce",
body => "$from has invited you to $channel",
<?doctype html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>
<script type="text/javascript">
document.observe("dom:loaded", function() {
$('output').insert($('foo').serialize());
});
</script>
</head>
map {$_->{channels} = [map {split ",", $_} @{$_->{channels}}]} map {values %{$_->config->servers}} $::catlady->all_cats;
if (window.fluid) {
window.fluid.showGrowlNotification({
title: subject,
description: message.body.unescapeHTML(),
priority: 1,
sticky: false,
identifier: message.msgid
});
}
--mimepart_4d77e7d9cb66b_2f87407d0b0275930
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
<%=3D render(:file =3D> "user_mailer/password_changed.text.plain.haml.html"=
).to_plain_text %>
this.messages.select('div.msg').each(function(msg){
msg.setStyle({borderWidth: "2px"});
msg.setStyle({borderWidth: "1px"});
});
my $pages = join "|", qw/chrome commands development faq features fluid guide
interest screenshots ssb status success thanks/;
get qr{^/(?<page>$pages)/?$} => sub {
my $captures = captures;
template $captures->{page};
};