Skip to content

Instantly share code, notes, and snippets.

View Getty's full-sized avatar
💭
building empires...

Torsten Raudssus Getty

💭
building empires...
View GitHub Profile
#!/usr/bin/perl
#
# Net::Twitter - OAuth desktop app example
#
use warnings;
use strict;
use Net::Twitter;
my $consumer_key = shift;
my $consumer_secret = shift;
torsten@pikachu:~/.cpan/build/Git-Wrapper-0.014-6oMCp_$ prove -lwv t/basic.t
t/basic.t ..
ok 1
ok 2
error: unknown option `porcelain'
usage: git-status [options] [--] <filepattern>...
-q, --quiet be quiet
-v, --verbose be verbose
@Getty
Getty / gist:820790
Created February 10, 2011 16:10
Sugar::Cane working
package Sugar::Cane;
# ABSTRACT: EXPERIMENTAL What you need to produce Sugar
use Moose ();
use Moose::Exporter;
use Moose::Util;
my ( $import, $unimport, $init_meta ) = Moose::Exporter->setup_import_methods(
with_meta => [ 'attributes' ]
);
package Sugar::Cane;
# ABSTRACT: EXPERIMENTAL What you need to produce Sugar
use Moose ();
use Moose::Exporter;
use Moose::Util;
use Data::Printer;
my ( $import, $unimport, $init_meta ) = Moose::Exporter->setup_import_methods(
with_meta => [ 'attributes' ],
package Sugar::Factory;
# ABSTRACT: EXPERIMENTAL The factory for producing your own Sugar
use Sugar::Cane ();
use Moose::Exporter;
use Moose::Util;
my ( $import, $unimport, $init_meta ) = Moose::Exporter->setup_import_methods(
with_meta => [ 'attributes' ],
class_metaroles => {
package Sugar::Cane;
# ABSTRACT: EXPERIMENTAL The base for a good sugar
use Moose ();
use Moose::Exporter;
use Data::Printer;
Moose::Exporter->setup_import_methods(
as_is => [ 'p' ],
with_meta => [ 'has' ],
package MySugarTest;
use Sugar;
has name => (
is => 'rw',
isa => 'Str',
);
1;
use MySugarTest::Test00Class;
my $obj = MySugarTest::Test00Class->new;
$obj->name('test');
use strict;
use warnings;
use Path::Dispatcher;
use Test::More;
my @calls;
my $dispatcher = Path::Dispatcher->new(
rules => [
Path::Dispatcher::Rule::Under->new(
use strict;
use warnings;
use Path::Dispatcher;
use Test::More;
my @calls;
my $dispatcher = Path::Dispatcher->new(
rules => [
Path::Dispatcher::Rule::Under->new(