Skip to content

Instantly share code, notes, and snippets.

NAME: Make sure search.cpan.org has Test::A8N
SUMMARY: If a tree falls in a forest, does the cpan indexer fall on it's ass?
PRECONDITIONS:
- ensure search.cpan.org is available
INSTRUCTIONS:
- goto page: Homepage
- search for: Test::A8N
- verify search results contain: Test::A8N
- verify author is: Michael A. Nachbaur
POSTCONDITIONS:
@konobi
konobi / Net::API::RPX test example.pl
Created October 13, 2009 19:04
An example of using named blocks in tests to help readability
Failure_Scenarios: {
my $rpx = Net::API::RPX->new({ api_key => 'test' });
{
local $HTTP::Response::SUCCESS = 0;
local $HTTP::Response::STATUS = '500 the tubes were clogged';
throws_ok {
$rpx->auth_info({ token => 'boo' })
} qr{Could not contact RPX: 500 the tubes were clogged}, 'LWP failure handled';
my $i = 0;
for my $result (@{ $obj->gain_results }){
is($result, $expected_result->[$i++], "Gained expected result");
}
#!/usr/bin/env perl
use strict;
use warnings;
use JavaScript;
use Data::Dumper;
my $runtime = JavaScript::Runtime->new();
my $ctx = $runtime->create_context();
Download perl-5.10.1 from http://www.cpan.org/src/perl-5.10.1.tar.gz
mkdir ~/local/
mkdir ~/local/perl_5.10
ln -s ~/local/perl_5.10 ~/local/perl
cd ~/local/
wget http://www.cpan.org/src/perl-5.10.1.tar.gz
tar -xzf perl-5.10.1.tar.gz
INST_PATH=$HOME/local/perl_5.10
RSP
perl 5.10.1
CPAN dependencies from the following: http://github.com/joyent/smart-platform/blob/for_the_devs/Makefile.PL
Spidermonkey 1.8 (no threads)
Gitosis
python
twisted
txamqp
rabbitmq
#!/usr/bin/env perl
use strict;
use warnings;
use JavaScript;
my @items = map { sub { } } (0..99);
my $things = 20_000;
my $runtime = JavaScript::Runtime->new( (1024 ** 2) * 2);
while($things--) {
use strict;
use warnings;
use Encode;
use HTTP::Request;
use LWPx::ParanoidAgent;
use JavaScript;
use Try::Tiny;
# In .ssh/config:
Host *
ControlMaster no # Connections by default are not a master
ControlPath ~/.ssh/master-%r@%h:%p
ServerAliveInterval 60
ServerAliveCountMax 60
# On normal connections, if there is no master running on the ControlPath it will behave as normal
ssh some.host
var require;
(function(){
var module = {};
require = function(module_name, stack){
if(!stack) stack = [];
var self = arguments.callee;
var resolved = resolve(module_name, stack);
var [use_string, breakup] = [resolved.identifier, resolved.breakup];