Skip to content

Instantly share code, notes, and snippets.

{
"backend_addr" : "tcp://127.0.0.1:5555",
"frontend_addr" : "tcp://127.0.0.1:6666",
"publisher_addr" : "tcp://127.0.0.1:7777",
"subscriber_addrs" : [
// one for each worker ...
"tcp://127.0.0.1:8880"
]
}
@stevan
stevan / gist:961851
Created May 9, 2011 00:33
Marriott Launch Plan
- git update all servers
- proxy
- app1
- app2
- registration
- db
- dump-all-databases
- dump property-registration separate (just in case)
@stevan
stevan / test
Created July 28, 2011 20:10
test
test
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use mop;
my $Foo = $::Class->new;
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use Test::Fatal;
use Test::Moose;
BEGIN {
::Class.meta.add_method('CREATE' => method (%params) {
# this just gathers all the
# attributes that were defined
# for the instances.
my %attrs;
my Dispatcher $dispatcher = $class.dispatcher(:descendant);
for WALKCLASS($dispatcher) -> Class $c {
for $c.get_attribute_list() -> $attr {
my $attr_obj = $c.get_attribute($attr);
%attrs{$attr} = instantiate_attribute_container($attr_obj);
::Class.meta.add_method('BUILDALL' => method (%params) returns Void {
my Dispatcher $dispatcher = $self.meta.dispatcher(:descendant);
for WALKMETH($dispatcher, 'BUILD') -> Method $method {
$method.($?SELF, %params);
}
});
sub ::WALKMETH {
my $dispatcher = shift;
{ ($dispatcher->() || return)->get_method(@_) || redo }
}
sub ::WALKCLASS {
return $_[0]->();
}
# get the dispatcher instance ....
my $dispatcher = $class->dispatcher(':canonical');
# walk the methods
my $method = ::WALKMETH($dispatcher, $label, %opts);
unless (defined $method) {
# if we find an AUTOLOAD anywhere in the chain, then we can use it ...
if ($method = ::WALKMETH($class->dispatcher(':canonical'), 'AUTOLOAD', %opts)) {
$class->STORE('$AUTOLOAD' => $label);
}
use Moose;
use Class::MOP::Attribute;
use Class::MOP::Class;
use Data::Dumper;
my $ass = Class::MOP::Class->create(
'FooBarski' => (
version => '0.01',
)
);