This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010; | |
use Convert::Binary::C; | |
my $c = Convert::Binary::C->new; | |
$c->Include(qw( | |
/usr/include | |
/usr/include/x86_64-linux-gnu/ | |
/usr/include/linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MarpaX::JSON; | |
use strict; | |
use Marpa::R2 2.039_000; | |
sub new { | |
my ($class) = @_; | |
my $self = bless {}, $class; | |
$self->{grammar} = Marpa::R2::Scanless::G->new( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13-03-08@21:19:28 (jdb) http://paste.stacka.to/gejavoyifo.pl | |
13-03-08@21:19:51 (jdb) This is the script that is called to build libxml on the PPM builders. | |
13-03-08@21:20:33 (jdb) It assumes the tarball is already unpacked and the CWD is the top-level directory inside the tarball | |
13-03-08@21:21:19 (jdb) http://paste.stacka.to/furanimeli.avrasm | |
13-03-08@21:21:31 (jdb) This is the "control file" | |
13-03-08@21:24:58 (Mithaldu) can you give me links for the iconv sources you use? | |
13-03-08@21:25:34 (jdb) https://code.google.com/p/win-iconv/ | |
13-03-08@21:26:05 (Mithaldu) and zlib? | |
13-03-08@21:26:33 (jdb) http://paste.stacka.to/guhelixuwo.pl | |
13-03-08@21:27:04 (jdb) http://zlib.net/zlib-1.2.5.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _inlinify_css_rules { | |
my $self = shift; | |
my $html = shift; | |
my $dom = Mojo::DOM->new($html); | |
for my $selector ( sort keys %rules ) { | |
my $styler = sub { | |
my $element = shift; | |
my $style = $element->attrs('style') // q{}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' => sub { | |
my $self = shift; | |
my $ua = Mojo::UserAgent->new; | |
my $tx = $ua->build_tx(GET => 'http://tempi.re'); | |
$tx->on(finish => sub { | |
my $tx = pop; | |
warn $tx->error; # premature connection close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub ok($;$) {$_[0] || $T::FAIL++; print( ($_[0] ? "ok " : "not ok ") . ++$T::NUM . ($_[1] ? " - $_[1]\n" : "\n"))} | |
sub done_testing { print "1..$T::NUM\n" } | |
END { $? ||= $T::FAIL; $? = 255 if $? > 255 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_source" : "module", | |
"aggregations" : { | |
"count" : { | |
"terms" : { | |
"field" : "distribution", | |
"size" : 999 | |
} | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Coro; | |
use Mojo::IOLoop; | |
# Magical class for calling a method non-blocking (with a closure) and | |
# rescheduling the current coroutine until it is done | |
package with::coro { | |
use Coro; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(w) { | |
/* | |
* Allow multiple clients share the same connection, but send/receive data on a topic they want | |
* | |
* var ws = WebSocketChannel("wss://example.com/mux", "testTopic"); | |
* var ws = WebSocketChannel("wss://example.com/mux", {topic: "..", protocols: ...}); | |
* var ws = WebSocketChannel({url: "wss://example.com/mux", topic: "..", protocols: ...}); | |
* ws.onopen = function(e) { this.send({some: data}) }; | |
*/ | |
w.WebSocketChannel = function(url, params) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Controller::Auth; | |
use Mojo::Base 'Mojolicious::Controller'; | |
sub check { | |
my $self = shift; | |
my $role = $self->stash('role'); | |
my $user = $self->current_user; | |
# User needs to log in or a different role |
OlderNewer