Skip to content

Instantly share code, notes, and snippets.

View perigrin's full-sized avatar

Chris Prather perigrin

View GitHub Profile
CmdUtils.CreateCommand({
name: "delicious",
description: "It is equivalent to the Delicious.com bookmarklet.",
icon: "http://delicious.com/favicon.ico",
homepage: "http://www.makadia.com",
author: { name: "Svapan Makadia", email: "[email protected]"},
help: "If you select some text, it will be placed in the notes field.",
preview: "Bookmark the current page to Delicious.com",
#!/usr/bin/perl
package SerialWatcher;
use metaclass 'MooseX::POE::SweetArgs';
use MooseX::POE;
use Symbol qw(gensym);
use Device::SerialPort;
use POE::Filter::Line;
use POE::Wheel::ReadWrite;
use POE::Wheel::ReadLine;
#!/usr/bin/perl
use strict;
use 5.10.0;
use LWP::Simple;
use JSON::Any;
use XML::Simple;
die 'Must provide starting URL' unless @ARGV;

Right so the rumor is that Moose has a lot of dependencies. I mean according to cpantesters Moose has 24 different dependencies! (Note: that same site says that almost all of those dependencies have a nearly 100% test record, but we're talking Quantity not Quality!). Let's examine this a bit more:

Here are the actual direct dependencies from Moose and Class::MOP's Makefile.PLs

Ever gotten stuck in traffic so bad you wanted to tell the world that right
here, right now something in your life sucks? Ever been at the coffeshop and
the cute barista gave you Large but charged for a small? Want to tell your
friends that coffeeshop rocks?
Thumb-Rate lets you do this. You can vote, thumbs up or thumbs down. Vote on
anything and it'll track where you were when you voted and display it with a
map on Thumb-Rate.com. So whip out your phone and say YES This Concert Rocks!
or tell the world that the burger joint just screwed up your order again. Two
clicks and everyone can know that right here, right now ... something sucks
Yuval has been [posting][1] [several][2] [entries][3] about [KiokuDB][4] and I
thought I'd give a chance to talk about how we had used for an application
currently on sale in the [iPhone store][5].
[Thumb-Rate][6] is a social app that allows you to simply vote up or down on
things in real life. It's not a complicated, and the source code clocks in at
3791 lines of perl including the Makefile.PL. The basic architecture is a
classic three tier webapp, Catalyst, TT2, and a object store. In addition to
this because we are hoping to have to handle massive throngs of users (calling
all THRONGS!), we have setup a work queue to offline the database writes, and
So one of the talks I had accepted to [YAPC][1] is on [XML::Toolkit][2], and I
thought I'd give a bit of a preview of what it is.
XML::Toolkit was created for a project that required de-serializing XML in to
Perl data, exposing that data to be edited, and then re-serializing it so a
Flash client could read it. Because of assumptions made by the Flash script,
child order was vital, so the XML had to not only round-trip semantically, it
had to round-trip structurally. The second fun fact was there was no DTD and
no schema. Some of the XML wouldn't even parse because it wasn't well formed,
but some work with the client sorted that.
package Net::Twitter::Lite::API::REST;
use Moose::Role;
use Net::Twitter::Lite::API::Sugar; # import the sugar
use namespace::autoclean;
with 'Net::Twitter::Lite::API';
base_url => sub { shift->apiurl || 'http://twitter.com' };
# Definition is stored as a sub in order to return a deep copy;

Classes Vs. Roles

Ovid [recently asked][1] if there was ever a reason to use Inheritance over Composition. Stevan [answered][6] that question rather eloquently but the whole thing has me thinking about the relationship between Classes and Roles and where (if anywhere) Abstract Classes have in this process.

Object Orientation has no bearing on the real world. It's framework for building metaphors that hopefully help programmers better model reality. You

State != Behavior

Ovid has [discovered][1] another "bug" (and by "bug" I mean documented feature ;) ). He has code that effectively does:

class MyClass {
    has my_method => ( default => 1);
}