This file contains hidden or 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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
char *sockname(int type) { | |
if (type == SOCK_STREAM) return "SOCK_STREAM"; |
This file contains hidden or 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 LWP::UserAgent::Cached 0.06; | |
use HTTP::Date; | |
mkdir '/tmp/cache'; | |
my $ua = LWP::UserAgent::Cached->new(cache_dir => '/tmp/cache'); | |
$ua->nocache_if(sub { | |
my $resp = shift; | |
$resp->code == 304; # do not cache not modified |
This file contains hidden or 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 Text::CSV; | |
use Text::Trim; | |
use HTML::Entities; | |
binmode STDOUT, ":utf8"; | |
my $dir = shift | |
or die "usage: $0 dir > output"; |
This file contains hidden or 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 feature 'say'; | |
use Geo::Distance; | |
use Geo::Point; | |
use JSON; | |
use LWP::UserAgent::Cached; | |
use Term::ANSIColor; | |
use List::Util 'reduce'; | |
use Math::Trig; |
This file contains hidden or 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; | |
package JUNOS::Config::Parser; | |
sub new { | |
my ($class, %cb) = @_; | |
bless \%cb, $class; | |
} | |
sub parse { |
This file contains hidden or 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 Coro::PatchSet 0.04; | |
BEGIN { | |
package IO::Select; | |
use Coro::Select; | |
use IO::Select; | |
} | |
use IO::Socket::Socks qw(:constants :DEFAULT); | |
use Coro; | |
use Coro::Socket; |
This file contains hidden or 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 Mojo::Reactor::EV; | |
use v5.10; | |
BEGIN { | |
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::EV'; | |
$ENV{MOJO_IOLOOP_DEBUG} = 1; | |
} | |
use Mojo::IOLoop; | |
use Mojo::UserAgent; | |
use AnyEvent::HTTP; |
This file contains hidden or 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 v5.10; | |
BEGIN { | |
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll'; | |
$ENV{MOJO_IOLOOP_DEBUG} = 1; | |
} | |
use Mojo::IOLoop; | |
use Mojo::UserAgent; | |
use Net::Async::HTTP; | |
use URI; |
This file contains hidden or 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 QtCore4; | |
use QtGui4; | |
package Ui_MainWindow; | |
use strict; | |
use warnings; | |
use QtCore4; | |
use QtGui4; |
This file contains hidden or 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; | |
get '/' => 'index'; | |
get '/ok' => 'index_ok'; | |
use Test::More; | |
plan tests => 6; |