Skip to content

Instantly share code, notes, and snippets.

View autarch's full-sized avatar

Dave Rolsky autarch

View GitHub Profile
use v6;
unit module App::insucalc;
subset Dir of IO::Handle where *.d;
sub MAIN( Dir :$root = $*HOME.child('.insucalc') ) is export {
App::insucalc::Runner.new( :root($root) ).run();
}
#!/bin/bash
set -x
ssh -T -C -R5900:localhost:5900 ct4-test.prv &
sudo iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 5900 -j ACCEPT
x11vnc -clip xinerama0 -localhost -nopw -once
sudo iptables -D INPUT -p tcp --dport 5900 -j ACCEPT
sudo iptables -D INPUT -p udp --dport 5900 -j ACCEPT
sub _dump_with_unicode ($self, $val) {
my $dumped = Dumper($val);
$dumped
=~ s/\\x\{([^}]+)\}/$self->_unicode_char_for($1)/eg;
return $dumped;
}
sub _unicode_char_for ($, $hex) {
my $num = eval '0x' . $hex;
not ok 1
1..1
# Failed test at t/test_moose/with_immutable.t line 52.
# Path: $_->[0]
# Failed Check: Test::Stream::Event::Note=HASH(0x39d1e88)->isa('Test::Stream::Event::Subtest')
# t/test_moose/with_immutable.t
# 31 [
# 40 0: (Event Type) Test::Stream::Event::Note=HASH(0x39d1e88)->isa('Test::Stream::Event::Subtest')
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
use strict;
use warnings;
use Test::Requires {
'Test::Stream::Tester' => 0,
'Test::Builder ' => '1.0302007',
};
use Test::Stream::Tester;
use Test::More;
# Subtest: Foo is not immutable
ok 1
1..1
ok 1 - Foo is not immutable
# Subtest: Foo is immutable
not ok 1
1..1
not ok 2 - Foo is immutable
{
events_are(
intercept {
with_immutable {
ok( Foo->meta->is_mutable );
}
'Foo';
},
events {
(19:56:26) #moose-dev: Topic for #moose-dev set by ether!karene@community.opers at 12:44:54 PM on 03/11/2015
(13:01:32) autarch: ether: looking more closely at does_via_delegation, I'm not convinced this implementation is at all sane
(13:01:49) autarch: having the metaclass rely on looking at an instantiated object to decide this seems very, very wrong
(13:02:00) autarch: metaclasses should provide info about the class, not the instance
(13:04:15) autarch: I'm not sure this is actually something we _can_ implement - if the only way to know if something does an interface is to look at the object, then that isn't a question for the metaclass - the implementation should be in Moose::Object alone
(14:03:05) ether: I think we could answer the question on an uninstantiated class if the attribute type is class_of(..)
(14:03:11) ether: er class_type(..)
(14:03:52) ether: I could go both ways on whether it's reasonable for $obj1->DOES(..) to return a different result than $obj2->DOES(..)
(14:04:14) ether: well, we hav
@autarch
autarch / gist:ee1569cb22c80208ff72
Created June 28, 2015 22:34
Script to update all my .travis.yml files at once
#!/usr/bin/env perl
use strict;
use warnings;
use 5.20.0;
use feature 'postderef';
no warnings 'experimental::postderef';
use File::pushd qw( pushd );
#!/usr/bin/env perl
use strict;
use warnings;
use 5.20.0;
use feature 'postderef';
no warnings 'experimental::postderef';
use File::pushd qw( pushd );