SlideShare a Scribd company logo
Writing Pluggable Software Tatsuhiko Miyagawa   [email_address] Six Apart, Ltd. / Shibuya Perl Mongers YAPC::Asia 2007 Tokyo
For non-JP attendees … If you find in the code, Replace that with backslash. (This is MS' fault)
Plaggable Software
Plaggable Software

Recommended for you

A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web

This document discusses the evolution of web development in Perl, from CGI scripts to modern PSGI-based frameworks. It introduces PSGI as an interface between web applications and web servers, and Plack as a toolkit for building PSGI applications and middleware. The document outlines many PSGI web servers and frameworks that can be used to build and deploy Perl web applications according to the PSGI standard.

plackperlpsgi
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming

If you are new to WordPress, but already know how to program, the typical "Hello, World" examples aren't helpful. You need to know how to make the right API calls, and where to find documentation about the actions and filters that WordPress makes available to you. This presentation is a brief introduction skimming the surface of the API hook system in WordPress. It does not go into deep detail, but gives brief "real world" examples of how to use filters and actions, along with pointers on where to find the main documentation that will help you get started on your own plugins.

pluginsactionswordpress
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax

This document provides an overview of using WordPress and AJAX. It discusses loading scripts and styles properly, using JavaScript localization to capture dynamic PHP content, page detection techniques, the wp_ajax action for handling AJAX requests, and the WP_Ajax_Response class for returning XML responses from AJAX callbacks. It also provides an example of building an AJAX registration form plugin with classes for handling the form, scripts, and styles.

wordpressajax
Pl u ggable Software
Agenda
#1 How to make your app pluggable
#2 TMTOWTDP There's More Than One Way To Deploy Plugins Pros/Cons by examples

Recommended for you

Django a whirlwind tour
Django   a whirlwind tourDjango   a whirlwind tour
Django a whirlwind tour

A quick introduction to Django with tips on deploying to Heroku. Presented at TechCamp Memphis, Fall 2012

pythonherokudjango
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites

The document discusses using the Migraine tool to migrate changes between development, staging, and production environments for a Drupal website. It outlines the development methodology, requirements for Migraine, and the workflow it uses to synchronize databases and file systems between environments with minimal downtime. Key aspects include categorizing database tables, taking backups, comparing schemas, and commands to dump, migrate, and restore databases.

drupalcampmukeshmigraine
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles

Keep hearing about Plack and PSGI, and not really sure what they're for, and why they're popular? Maybe you're using Plack at work, and you're still copying-and-pasting `builder` lines in to your code without really knowing what's going on? What's the relationship between Plack, PSGI, and CGI? Plack from first principles works up from how CGI works, the evolution that PSGI represents, and how Plack provides a user-friendly layer on top of that.

plackperlpsgi
First-of-all: Why pluggable?
Benefits
#1 Keep the app design and code simple
#2 Let the app users customize the behavior (without hacking the internals)

Recommended for you

The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django

The document discusses best practices and anti-patterns for Django projects. It recommends keeping projects simple by avoiding over-engineering, using application-based modular design, and properly structuring settings files across multiple environments rather than relying on local_settings.py files. It also addresses common issues like import errors caused by PYTHONPATH configuration.

bestpracticespythondjango
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin

Jenkins User Conference 2012 Only by the third plugin do you get the hang of writing a plugin. I thought as a developer coming to the build side of things it'd be easy to jump in and write some plugins. I was wrong. Don't be fooled by the extremely friendly Jenkins community, writing a plugin from scratch is harder than they let on. This talk will explain the hurdles that I had to cross to make writing plugins easy.

pluginsjenkinshudson
Ant
Ant Ant
Ant

Ant is a Java-based build tool that is platform independent like Make but without its limitations. It uses XML configuration files and tasks run by Java objects to define projects and targets. Projects contain attributes and targets which contain tasks. Common tasks include compiling code and copying files. Properties are used to reference variables within the XML file. Ant is easy to use, extensible, standardized, and open source.

#3 It's  fun  to write plugins for most hackers (see: Plagger and Kwiki)
"Can your app do XXX?" "Yes, by plugins."
"Your app has a bug in YYY" "No, it's the bug in plugin YYY, Not my fault." (Chain Of Responsibilities)
Good Enough Reasons, huh?

Recommended for you

High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014

Slides for my talk "High Quality Symfony Bundles" tutorial at the Dutch PHP Conference 2014 (http://phpconference.nl).

symfony2bundles
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010

Plack is a superglue for Perl web frameworks that provides a common interface called PSGI (Perl Web Server Gateway Interface) inspired by WSGI and Rack. PSGI allows any web application or framework to run on any web server by providing a standard way for applications to communicate with servers. Plack also includes tools like Plackup for running PSGI applications from the command line and middleware for common functionality that can be shared across frameworks. Many existing Perl web frameworks have been adapted to run under PSGI through Plack.

plack psgi yapcna2010 yapc perl
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask

This document summarizes how to build a web application using Flask. It introduces HTTP requests and responses, and how Flask works with request and response objects. It then provides an example of building a basic Flask app with a view function to display "Hello World", and how to use Jinja templates to separate code and markup. The document also discusses using HTML forms to submit data via GET and POST requests.

web developmentpythonflask
#1 Make your app pluggable
Example
ack (App::Ack)
grep –r for programmers

Recommended for you

Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP

This talk was given at the Dutch PHP Conference 2011 and details the use of Comet (aka reverse ajax or ajax push) technologies and the importance of websockets and server-sent events. More information is available at http://joind.in/3237.

king foodpc11php
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop

This document discusses using PHP for both web and desktop applications. It introduces PHP-GTK, which allows PHP to create graphical desktop applications with a native look and feel across platforms. It provides examples of creating windows, containers, working with signals and the main loop. The document also discusses installing PHP-GTK, some key considerations for desktop applications, and examples of creating widgets like trees and working with models.

zendcon 2009php-gtkdesktop
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS

The document discusses 10 steps to make a Django site more responsive by adding a REST API and using AngularJS for the front-end: 1) Create an API endpoint for the Django models, 2) Set up the JavaScript environment and install AngularJS, 3) Create a static AngularJS site, 4) Use verbatim tags to avoid conflicts between Django and AngularJS variables, 5) Connect AngularJS to the API, 6) Take advantage of the Django REST Framework features, 7) Handle asynchronous data loading, 8) Add forms and POST requests, 9) Clean up settings.py, and 10) Document the API. The goal is to keep the back-end lightweight Django while building a more responsive and

restdjangoangularjs
Ack is a "full-stack" software now.
By "full-stack" I mean: Easy install No configuration No way to extend
Specifically: These are hardcoded Ignored directories Filenames and types
Ignored Directories @ignore_dirs = qw( blib CVS RCS SCCS .svn _darcs .git );

Recommended for you

Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers

Plack provides a common interface called PSGI (Perl Server Gateway Interface) that allows Perl web applications to run on different web servers. It includes tools like Plackup for running PSGI applications from the command line and middleware for adding functionality. Plack has adapters that allow many existing Perl web frameworks to run under PSGI. It also provides high performance PSGI servers and utilities for building and testing PSGI applications.

plackpsgiperl oasis
Getting modern with logging via log4perl
Getting modern with logging via log4perlGetting modern with logging via log4perl
Getting modern with logging via log4perl

Log4perl is a logging module for Perl that provides a structured and configurable logging framework inspired by Log4j. It allows logging messages to be sent to files, databases, the console or other outputs. The configuration file defines loggers, log levels and appenders (output destinations). Log4perl provides methods for different log levels and metadata like timestamps. Consistent structured log messages can help with parsing and analysis. Planning logging guidelines and designing messages accordingly helps ensure logs are useful.

perl logging log4perl
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication

The document discusses using CGI::Application, Template::Toolkit, and DBIx::Class to create simple web applications in Perl. It provides an overview of MVC architecture and how these three modules separate code into the Model, View, and Controller components. It includes sample code for setting up a basic application using these modules, interacting with a database via DBIx::Class, and rendering views with Template::Toolkit.

cgiapplicationperlfrozenperl
Filenames and languages mapping %mappings = ( asm  => [qw( s S )], binary  => …, cc  => [qw( c h xs )], cpp  => [qw( cpp m h C H )], csharp  => [qw( cs )], … perl  => [qw( pl pm pod tt ttml t )], … );
What if making these pluggable?
DISCLAIMER
Don't get me wrong Andy, I love ack the way it is… Just thought it can be a very good example for the tutorial.

Recommended for you

Quality Use Of Plugin
Quality Use Of PluginQuality Use Of Plugin
Quality Use Of Plugin

Yasuo Harada is a PHP developer in Osaka who blogs about slyly walking PHP techniques. He gave a presentation about using plugins in three stages: 1) Organize functionality into plugins by feature, 2) Share generic plugins between applications, and 3) Gradually improve plugins during development and repair. Plugins can be used to add features like debugging, user management, mailing, and theming. Templates, assets, and translations can be included in plugins and used in applications. Custom dispatchers can be created to handle asset loading from plugins.

cakephp cakematsuri
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids

Mojolicious is a fast web development tool that is easy to start with, use, and extend. It facilitates best practices without enforcing them. Bootstrap from Twitter is very user-friendly across browsers. Mojolicious is light, flexible, and easy.

bootstrapmojoliciousperl
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010

The document discusses Dancer, a lightweight web framework for Perl that provides an alternative to CGI.pm with routing, templates, sessions and more. Dancer uses PSGI to interface with various web servers and includes features like routing, templates, sessions, logging, serialization and plugins to enrich functionality. The framework is actively developed with a community on GitHub and IRC providing documentation and additional modules.

dancerframeworkperl
Quickstart: Class::Trigger Module::Pluggable © Six Apart Ltd. Employees
Class::Trigger SYNOPSIS package Foo; use Class::Trigger; sub foo { my $self = shift; $self->call_trigger('before_foo'); # some code ... $self->call_trigger('after_foo'); } package main; Foo->add_trigger(before_foo => amp;sub1); Foo->add_trigger(after_foo => amp;sub2);
Class::Trigger Helps you to implement Observer Pattern. (Rails calls this Observer)
Module::Pluggable SYNOPSIS package MyClass; use Module::Pluggable; use MyClass; my $mc = MyClass->new(); # returns the names of all plugins installed under MyClass::Plugin::* my @plugins = $mc->plugins(); package MyClass::Plugin::Foo; sub new { … } 1;

Recommended for you

What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10

The document summarizes new features and improvements in Zend Framework 1.10, including new components like Zend_Barcode and Zend_Feed_Writer, improvements to existing components, new services like LiveDocx and DeveloperGarden, and updates to the documentation.

phpzend framework
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks

The document discusses Perl web frameworks Catalyst and Mojolicious. It provides an overview of key MVC concepts like routers, controllers, models and views. It then demonstrates how to install and create a basic Catalyst application with a root controller and default action. It also covers additional Catalyst controller features like actions, routes, context object and chained actions.

barcelona.pmperlcatalyst
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst

This document provides an overview of using Perl web frameworks Catalyst and Mojolicious. It discusses MVC architecture and components like routers, controllers, models, and views. It also covers installing frameworks via CPAN, creating Catalyst applications, adding controllers, views using Template Toolkit, and models using DBIC. Authentication and authorization plugins for Catalyst are also mentioned.

Setup plugins in App::Ack package App::Ack; use Class::Trigger; use Module::Pluggable require => 1; __PACKAGE__->plugins;
Setup plugins in App::Ack package App::Ack; use Class::Trigger; use Module::Pluggable  require => 1 ; __PACKAGE__->plugins; # "requires" modules
Ignored Directories (Before) @ignore_dirs = qw( blib CVS RCS SCCS .svn _darcs .git );
Ignored Directories (After) # lib/App/Ack.pm __PACKAGE__->call_trigger(' ignore_dirs.add ', ignore_dirs);

Recommended for you

Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo

The document provides an overview of using AJAX capabilities in Grails applications with the Dojo JavaScript library. It discusses getting started with Dojo in Grails, Grails AJAX tags for basic AJAX functionality, rendering JSON responses from controllers, and how Grails supports more complex Dojo widgets and functionality beyond basic AJAX.

Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps

The document discusses Ratpack, a Groovy web framework for building simple and compact web applications. It provides an overview of Ratpack's features like routing, templating and deployment, and demonstrates how to build sample applications including a blog and todo list app. Examples are shown of integrating technologies like MongoDB, CoffeeScript, and Markdown within Ratpack applications.

springone2gxstrangeloop
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)

The document discusses optimizing Drupal site deployments using Drush and Drush Make. It describes what Drush and Drush Make are and how they can be used to script reliable and flexible site deployments. The document also discusses Features and alternative strategies for programmatically deploying and updating sites using custom modules.

drupalscriptdrush make
Ignored Directories (plugins) # lib/App/Ack/Plugin/IgnorePerlBuildDir.pm package App::Ack::Plugin::IgnorePerlBuildDir; App::Ack->add_trigger( " ignore_dirs.add " => sub { my($class, $ignore_dirs) = @_; push @$ignore_dirs, qw( blib ); }, ); 1;
Ignored Directories (plugins) # lib/App/Ack/Plugin/IgnoreSourceControlDir.pm package App::Ack::Plugin::IgnoreSourcdeControlDir; App::Ack->add_trigger( " ignore_dirs.add " => sub { my($class, $ignore_dirs) = @_; push @$ignore_dirs, qw( CVS RCS .svn _darcs .git ); }, ); 1;
Filenames and languages (before) %mappings = ( asm  => [qw( s S )], binary  => …, cc  => [qw( c h xs )], cpp  => [qw( cpp m h C H )], csharp  => [qw( cs )], … perl  => [qw( pl pm pod tt ttml t )], … );
Filenames and languages (after) # lib/App/Ack.pm __PACKAGE__->call_trigger('mappings.add', mappings);

Recommended for you

Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl Dancer

Dancer is a micro web framework for Perl that allows developers to build web applications in an expressive and lightweight manner. It uses a routing-based syntax to define request handlers for different URLs and HTTP methods. Dancer applications can utilize templates, configuration files, and environments to customize settings depending on the deployment stage. Being PSGI/Plack compliant, Dancer applications can be deployed on various web servers through Plack adapters.

dancerframeworkperl
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?

An overview of the major new features and changes in Rails 2.0. Originally presented on December 11th, 2007 at NYC.rb.

Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)

The document discusses various techniques for creating dynamic interfaces with jQuery in Drupal, including: 1. Letting Drupal know about jQuery through modules or themes using functions like drupal_add_js(). 2. Writing JavaScript code to modify and interact with page elements. 3. Providing examples that dynamically modify navigation menus, add character counters to forms, and create multi-page forms.

Filenames and languages (plugins) package App::Ack::Plugin::MappingCFamily; use strict; App::Ack->add_trigger( "mappings.add" => sub { my($class, $mappings) = @_; $mappings->{asm} = [qw( s S )]; $mappings->{cc}  = [qw( c h xs )]; $mappings->{cpp} = [qw( cpp m h C H )]; $mappings->{csharp} = [qw( cs )]; $mappings->{css} = [qw( css )]; }, ); 1;
Works great  with few lines of code!
Now it's time to add  Some useful stuff.
Example Plugin: Content Filter

Recommended for you

Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs

My talk from WordCamp Mid-Atlantic 2010, at Johns Hopkins University in Baltimore, Maryland on Sept. 11.

wordpress
非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki

Non-blocking processing notifications with Tatsumaki can provide laughter, tears, cuteness, and surprises over 20 minutes. Some details may not translate well from the slide version and some meanings may be lost, but the overall atmosphere can be enjoyed in the official video release. The presentation introduces asynchronous processing using PSGI/Plack to avoid blocking the server. It discusses non-blocking, streaming, an overview of PSGI/Plack, and the PSGI streaming specification.

tatsumakiyapcasia2010yapc
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...

The document discusses Satellite Apps, which allow integrating systems with JIRA Studio using remote APIs. Satellite Apps can be used for reporting, integration, and automation scenarios. Examples provided include using APIs to access issue details, create and modify pages, and automatically replace text in pages.

computingjira studioapplication programming interface
sub _search { my $fh = shift; my $is_binary = shift; my $filename = shift; my $regex = shift; my %opt = @_; if ($is_binary) { my $new_fh; App::Ack->call_trigger('filter.binary', $filename, new_fh); if ($new_fh) { return _search($new_fh, 0, $filename, $regex, @_); } }
Example: Search PDF content with ack
PDF filter plugin package App::Ack::Plugin::ExtractContentPDF; use strict; use CAM::PDF; use File::Temp; App::Ack->add_trigger( 'mappings.add' => sub { my($class, $mappings) = @_; $mappings->{pdf} = [qw(pdf)]; }, );
PDF filter plugin (cont.) App::Ack->add_trigger( 'filter.binary' => sub { my($class, $filename, $fh_ref) = @_; if ($filename =~ /pdf$/) { my $fh = File::Temp::tempfile; my $doc = CAM::PDF->new($file); my $text; for my $page (1..$doc->numPages){ $text .= $doc->getPageText($page); } print $fh $text; seek $$fh, 0, 0; $$fh_ref = $fh; } }, );

Recommended for you

Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605

The document discusses Satellite Apps, which allow integrating systems with JIRA Studio using remote APIs. Satellite Apps can be used for reporting, integration, and automation scenarios. Examples provided include using APIs to access issue details, create and modify pages, and automatically replace text in pages.

atlassian
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp

My colleague Adnan created this slide and on behalf of him i am uploading this slide. A nice Visual Diagram is there on the SERVER CLIENT concept. Must see for newbie.

phpmysqlapache
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php

The document provides an overview of model-view-controller (MVC) development using the CodeIgniter PHP framework. It discusses MVC patterns and variations, why CodeIgniter was chosen, CodeIgniter's implementation of MVC, basics of using CodeIgniter including its directory structure and core classes, and examples of building a basic web application and API with CodeIgniter.

codeignitermvcphp
PDF search > ack --type=pdf Audrey yapcasia2007-pugs.pdf:3:Audrey Tang
Homework Use File::Extract To handle arbitrary media files
Homework 2: Search non UTF-8 files (hint: use Encode::Guess) You'll need another hook.
Summary Class::Trigger + Module::Pluggable = Pluggable app easy

Recommended for you

Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool

Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts. All code in the presentation has not necessarily been tested. Will update presentation when done.

Carton CPAN dependency manager
Carton CPAN dependency managerCarton CPAN dependency manager
Carton CPAN dependency manager

This document summarizes a presentation about managing CPAN dependencies for web development projects. It describes a case study where a developer installed many CPAN modules for a new web app, but ran into problems with dependency and versioning issues during deployment to production servers. The presenter then introduced their solution called Carton, a tool for creating isolated, local Perl environments for apps and locking dependency versions to allow reproducible, stable deployments across different machines. Key features discussed included dependency declaration, isolated environments, version control, analysis and more. The document concludes with a call for questions and thanks.

carton perl cpan yapc yapcasia
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011

This document discusses deploying Plack web applications. It begins with an overview of the PSGI specification and how it allows various web frameworks like Catalyst and Dancer to run on different web servers through a common interface. It then discusses various options for the server environment including standalone HTTP servers like Starman and FastCGI servers. Finally, it covers useful Plack middleware for application environments, including modules for rate limiting, caching, authentication, and more.

plack psgi web perl oscon2011 oscon
#2 TMTOWTDP There's More Than One Way To Deploy Plugins
Module::Pluggable + Class::Trigger = Simple and Nice but has limitations
In Reality,  we need more control over how plugins behave
1) The order of  plugin executions

Recommended for you

Plack at OSCON 2010
Plack at OSCON 2010Plack at OSCON 2010
Plack at OSCON 2010

Plack is a superglue for Perl web frameworks that provides a common interface called PSGI (Perl Server Gateway Interface). PSGI allows any web application that returns status, headers, and content to work with any PSGI-compliant web server without needing server-specific code. Plack provides middleware, servers, and tools to develop and run PSGI applications. It allows frameworks like Catalyst, Dancer, and CGI::Application to run on many web servers like Starman, Twiggy, and mod_psgi without changes to framework code.

plack perl psgi oscon2010
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010

cpanminus (cpanm) is an awesome and lightweight CPAN installer with zero dependencies. It requires less than 10MB of RAM, has no interactive shell, uses sane defaults with quiet output, and can be easily upgraded via a single command. The document recommends starting to use cpanm and provides tips on commands like --prompt, --notest, and using it with PERL_CPANM_OPT and perlbrew.

cpan perl yapc
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW

Plack is a Perl web server gateway interface (PSGI) toolkit that provides a standard interface between web applications written in Perl and web servers. It includes reusable middleware, a reference PSGI server, handlers for connecting to different web servers like CGI and FastCGI, and tools for running and testing PSGI applications. Many popular Perl web frameworks have adapted to work with PSGI/Plack.

plack psgi perl osdctw2010
2) Per user configurations for plugins
3) Temporarily Disable plugins Should be easy
4) How to install & upgrade plugins
5) Let plugins  have storage area

Recommended for you

CPAN Realtime feed
CPAN Realtime feedCPAN Realtime feed
CPAN Realtime feed

This document summarizes how a new module is uploaded and distributed on CPAN. It takes approximately 48 hours from when an author uploads a module until it is available to most users. To address this, a real-time CPAN feed was created using FriendFeed to notify users more quickly, within an hour, after a new module is uploaded. The cpanf application allows users to install new CPAN modules via these real-time feeds to get modules more quickly than waiting for the standard 24 hour CPAN cache update.

yapcasia2009cpanperl
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery

Building a desktop app using HTTP::Engine as a micro web server, SQLite for data storage, and jQuery for the user interface. Comet and asynchronous workers are used to enable real-time features. JSON-RPC and routing are implemented to support AJAX actions. The combination provides a lightweight "desktop app" architecture that is cross-platform.

remedieyapcasia2009yapc
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEventAsynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
yapcasia2009yapcanyevent
Etc, etc.
Examples: Kwiki Plagger qpsmtpd Movable Type
I won't talk about Catalyst plugins (and other framework thingy)
Because they're  NOT "plug-ins"

Recommended for you

Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery

This document provides a summary of a presentation on building a desktop application using HTTP::Engine, SQLite, and jQuery. The presentation discusses using HTTP::Engine as a lightweight web server, implementing RESTful APIs and backend actions with JSON responses, using SQLite for a simple and flexible local database, and manipulating the DOM with jQuery for the user interface. The goal is to create a desktop-like experience with the technologies of web applications.

remediejquery
Remedie OSDC.TW
Remedie OSDC.TWRemedie OSDC.TW
Remedie OSDC.TW

Remedie is a media RSS browser written in Perl and jQuery. It aggregates RSS/Atom feeds and supports playing videos and audio inline with Flash or QuickTime. Features include support for Media RSS, custom plugins, playback options, local video folders, and an iPhone-like UI. A demo is provided showing features like continuous playback, hotkeys, drag and drop, incremental search and more. The roadmap includes making the daemon non-blocking and adding downloads, social network integration and an iPhone remote.

osdc.twremedie280slides
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
itprochallenge
Install plugins  And now you write  MORE CODE
95% of Catalyst plugins Are NOT "plugins" But "components" 95% of these statistics is made up by the speakers.
Kwiki 1.0
Kwiki Plugin code package Kwiki::URLBL; use  Kwiki::Plugin -Base ; use Kwiki::Installer -base; const class_id  => 'urlbl'; const class_title => 'URL Blacklist DNS'; const  config_file => 'urlbl.yaml'; sub register { require URI::Find; my $registry = shift; $registry->add(hook => 'edit:save', pre => 'urlbl_hook'); $registry->add(action => 'blacklisted_url'); }

Recommended for you

20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about

The document shows code for parsing and handling XML using different Perl modules. It demonstrates parsing XML strings into DOM documents using XML::LibXML and XML::Liberal, handling XML encoding such as entities and namespaces, and extracting elements and contents from the parsed DOM documents.

yapcasia2008yapcperl
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LTWeb::Scraper for SF.pm LT
Web::Scraper for SF.pm LT

This document introduces the Web::Scraper module for Perl, which provides a more robust and maintainable way to scrape web pages compared to regular expressions. Web::Scraper uses a DSL to select elements and extract data via CSS or XPath selectors. It returns structured data like URLs, text, and name-value pairs from selected elements. The document provides examples of scraping timestamps, links, and lists of sites to demonstrate how Web::Scraper works and its advantages over traditional scraping with regular expressions.

Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8

The document discusses using Web::Scraper to scrape web pages in a robust, maintainable way by using CSS selectors and XPath queries rather than fragile regular expressions. Web::Scraper provides a domain-specific language for defining scraping processes and extracting desired data from web pages into structured results. Examples show how to scrape links, text, and nested data from HTML elements using a simple declarative syntax.

Kwiki Plugin (cont.) sub urlbl_hook { my $hook = pop; my $old_page = $self->hub->pages->new_page($self->pages->current->id); my $this  = $self->hub->urlbl; my @old_urls = $this->get_urls($old_page->content); my @urls  = $this->get_urls($self->cgi->page_content); my @new_urls = $this->get_new_urls(old_urls, urls); if (@new_urls && $this->is_blocked(new_urls)) { $hook->cancel(); return $self->redirect("action=blacklisted_url"); } }
Magic implemented in Spoon(::Hooks)
"Install" Kwiki Plugins # order doesn't matter here (according to Ingy) Kwiki::Display Kwiki::Edit Kwiki::Theme::Basic Kwiki::Toolbar Kwiki::Status Kwiki::Widgets # Comment out (or entirely remove) to disable # Kwiki::UnnecessaryStuff
Kwiki plugin config # in Kwiki::URLBL plugin __config/urlbl.yaml__ urlbl_dns: sc.surbl.org, bsb.spamlookup.net, rbl.bulkfeeds.jp # config.yaml urlbl_dns: myowndns.example.org

Recommended for you

Web::Scraper
Web::ScraperWeb::Scraper
Web::Scraper

The document discusses practical web scraping using the Web::Scraper module in Perl. It provides an example of scraping the current UTC time from a website using regular expressions, then refactors it to use Web::Scraper for a more robust and maintainable approach. Key advantages of Web::Scraper include using CSS selectors and XPath to be less fragile, and proper handling of HTML encoding.

XML::Liberal
XML::LiberalXML::Liberal
XML::Liberal

The document discusses XML::Liberal, a Perl module that allows XML parsers to successfully parse XML documents that contain errors. It provides examples of how XML::Liberal can be used to override an existing XML parser like XML::LibXML to make it more liberal in parsing invalid XML. It also shows how XML::Liberal can be used to try parsing XML with a fallback parser if the primary parser fails due to errors in the XML.

Test::Base
Test::BaseTest::Base
Test::Base

The document discusses Test::Base, a Perl module for data-driven testing. It provides examples of using Test::Base for testing functions, with compatibility with Test::More. Test::Base allows writing tests in a simple format and filtering of input/output. It also supports features like default blocks, block-specific tests, subclassing and more. Tips discussed include avoiding chomp filters and separating success and error tests.

Kwiki plugins are CPAN modules
Install and Upgrade plugins cpan> install Kwiki::SomeStuff
Using CPAN as a repository Pros #1: reuse most of current CPAN infrastructure.
Using CPAN as a repository Pros #2: Increasing # of modules = good motivation  for Perl hackers

Recommended for you

Hacking Vox and Plagger
Hacking Vox and PlaggerHacking Vox and Plagger
Hacking Vox and Plagger

at DECON (Developers environment conference) 2006 in Tokyo.

Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet

Plagger is a pluggable RSS/Atom aggregator that allows users to combine ("pipe") various plugins to customize how feeds are aggregated, filtered, and published/notified. It aims to be the "UNIX pipe of the internet" by providing a simple yet powerful framework to connect different data sources and processing modules in a customizable workflow. The document provides many examples of how Plagger can be used to aggregate feeds from sources like Bloglines or OPML files and publish them to email via Gmail by chaining together relevant subscription, filter, and publish plugins.

Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher

This document discusses integrating Google Maps with tilt input from a laptop. It provides code examples in C++, Ruby and Perl for reading tilt sensor data on Windows. It also shows how to combine Google Maps JavaScript API with Perl code to update the map based on tilt input detected by Perl.

Cons #1: Installing CPAN deps could be a mess (especially for Win32)
Cons #2: Whenever Ingy releases new Kwiki, lots of plugins just break.
Kwiki plugin storage return if  grep {$page->id} @{$self-> config->cached_display_ignore }; my $html = io->catfile( $self-> plugin_directory ,$page->id )->utf8;
Kwiki 2.0

Recommended for you

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf

Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.

infrastructure as codeclouddevops
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf

To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.

data recoverydatadiskwarrior
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

Same as Kwiki 1.0
Except: plugins are now in SVN repository
 
Plagger plugin package Plagger::Plugin::Publish::iCal; use strict; use base qw(  Plagger::Plugin  ); use Data::ICal; use Data::ICal::Entry::Event; use DateTime::Duration; use DateTime::Format::ICal; sub register { my($self, $context) = @_; $context-> register_hook ( $self, ' publish.feed ' => amp;publish_feed, ' plugin.init  ' => amp;plugin_init, ); }

Recommended for you

Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers

The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era. Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.

programmingcodingcivil engineering
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024

Everything that I found interesting last month about the irresponsible use of machine intelligence

quantumfaxmachine
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter

Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.

Plagger plugin (cont) sub plugin_init { my($self, $context) = @_; my $dir =  $self->conf->{dir}; unless (-e $dir && -d _) { mkdir $dir, 0755 or $context->error("Failed to mkdir $dir: $!"); } }
Plagger plugin storage $self->conf->{invindex} ||= $self-> cache->path_to ('invindex');
Plagger plugin config # The order matters in config.yaml # if they're in the same hooks plugins: - module: Subscription::Config config: feed: - http://www.example.com/ - module: Filter::DegradeYouTube config: dev_id: XYZXYZ - module: Publish::Gmail disable: 1
Plugins Install & Upgrade cpan> notest install Plagger # or … > svn co http://…/plagger/trunk plagger > svn update

Recommended for you

Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx

MuleSoft Meetup on APM and IDP

mulesoftai
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure

Recent advancements in the NIST-JARVIS infrastructure: JARVIS-Overview, JARVIS-DFT, AtomGPT, ALIGNN, JARVIS-Leaderboard

jarvisjarvis-dftalignn
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
Plagger impl. ripped off by many apps now
qpsmtpd
mod_perl for SMTP Runs with tcpserver, forkserver  or Danga::Socket standalone
Plugins: Flat files rock:/home/miyagawa/svn/qpsmtpd> ls -F plugins async/  greylisting auth/  hosts_allow check_badmailfrom  http_config check_badmailfromto  ident/ check_badrcptto  logging/ check_badrcptto_patterns  milter check_basicheaders  parse_addr_withhelo check_earlytalker  queue/ check_loop  quit_fortune check_norelay  rcpt_ok check_relay  relay_only check_spamhelo  require_resolvable_fromhost content_log  rhsbl count_unrecognized_commands  sender_permitted_from dns_whitelist_soft  spamassassin dnsbl  tls domainkeys  tls_cert* dont_require_anglebrackets  virus/

Recommended for you

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection

Cybersecurity is a major concern in today's connected digital world. Threats to organizations are constantly evolving and have the potential to compromise sensitive information, disrupt operations, and lead to significant financial losses. Traditional cybersecurity techniques often fall short against modern attackers. Therefore, advanced techniques for cyber security analysis and anomaly detection are essential for protecting digital assets. This blog explores these cutting-edge methods, providing a comprehensive overview of their application and importance.

cybersecurityanomaly detectionadvanced techniques
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024

Everything that I found interesting about engineering leadership last month

quantumfaxmachine
qpsmtpd plugin sub  hook_mail  { my ($self, $transaction, $sender, %param) = @_; my @badmailfrom =  $self->qp->config ("badmailfrom") or return (DECLINED); for my $bad (@badmailfrom) { my $reason = $bad; $bad =~ s/^*(+).*/$1/; next unless $bad; $transaction->notes('badmailfrom', $reason) … } return (DECLINED); }
Actually qpsmtpd Plugins are "compiled" to modules
my $eval = join("", "package $package;", 'use Qpsmtpd::Constants;', "require Qpsmtpd::Plugin;", 'use vars qw(@ISA);', 'use strict;', '@ISA = qw(Qpsmtpd::Plugin);', ($test_mode ? 'use Test::More;' : ''), "sub plugin_name { qq[$plugin] }", $line, $sub, "", # last line comment without newline? ); $eval =~ m/(.*)/s; $eval = $1; eval $eval; die "eval $@" if $@;
qpsmtpd plugin config rock:/home/miyagawa/svn/qpsmtpd> ls config.sample/ config.sample: IP  logging  require_resolvable_fromhost badhelo  loglevel  rhsbl_zones badrcptto_patterns  plugins   size_threshold dnsbl_zones  rcpthosts  tls_before_auth invalid_resolvable_fromhost  relayclients  tls_ciphers

Recommended for you

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf

In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.

social media hackerfacebook hackerhire a instagram hacker
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...

Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.

insider securitycybersecurity threatsenterprise security
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
config/plugins # content filters virus/klez_filter # rejects mails with a SA score higher than 2 spamassassin reject_threshold 20
config/badhelo # these domains never uses their domain when greeting us, so reject transactions aol.com yahoo.com
Install & Upgrade plugins Just use subversion
 

Recommended for you

Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant

Password Rotation in 2024 is still Relevant

passwordmanagementrotation
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference

We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner! We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too! Check out our proposed agenda below 👇👇 08:30 ☕ Welcome coffee (30') 09:00 Opening note/ Intro to UiPath Community (10') Cristina Vidu, Global Manager, Marketing Community @UiPath Dawid Kot, Digital Transformation Lead @Proservartner 09:10 Cloud migration - Proservartner & DOVISTA case study (30') Marcin Drozdowski, Automation CoE Manager @DOVISTA Pawel Kamiński, RPA developer @DOVISTA Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 09:40 From bottlenecks to breakthroughs: Citizen Development in action (25') Pawel Poplawski, Director, Improvement and Automation @McCormick & Company Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company 10:05 Next-level bots: API integration in UiPath Studio (30') Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 10:35 ☕ Coffee Break (15') 10:50 Document Understanding with my RPA Companion (45') Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath 11:35 Power up your Robots: GenAI and GPT in REFramework (45') Krzysztof Karaszewski, Global RPA Product Manager 12:20 🍕 Lunch Break (1hr) 13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30') Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance 13:50 Communications Mining - focus on AI capabilities (30') Thomasz Wierzbicki, Business Analyst @Office Samurai 14:20 Polish MVP panel: Insights on MVP award achievements and career profiling

#uipathcommunity#automation#automationdeveloper
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges

accommodate the strengths, weaknesses, threats and opportunities of autonomous vehicles

automotive self-driving car technology
MT plugins are  flat-files (or scripts that call modules)
MT plugin code package MT::Plugin::BanASCII;  our $Method = "deny"; use MT;  use MT::Plugin;  my $plugin = MT::Plugin->new({ name => "BanASCII v$VERSION", description => "Deny or moderate ASCII or Latin-1 comment", });  MT->add_plugin($plugin); MT->add_callback('CommentFilter', 2, $plugin, amp;handler);
MT plugin code (cont) sub init_app {  my $plugin = shift; $plugin->SUPER::init_app(@_); my($app) = @_; return unless $app->isa('MT::App::CMS'); $app-> add_itemset_action ({  type => 'comment', key => 'spam_submission_comment', label => 'Report SPAM Comment(s)', code => sub {  $plugin->submit_spams_action('MT::Comment', @_) },  } );
 

Recommended for you

TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In

Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk. What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year? Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year. This webinar will review: - Key changes to privacy regulations in 2024 - Key themes in privacy and data governance in 2024 - How to maximize your privacy program in the second half of 2024

data privacyprivacy complianceai
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation

Manual Method of Product Research | Helium10 | MBS RETRIEVER

product researchhelium10 | mbs retriever
 
MT plugin storage require MT::PluginData; my $data = MT::PluginData->load({ plugin => 'sidebar-manager', key  => $blog_id }, ); unless ($data) { $data = MT::PluginData->new; $data->plugin('sidebar-manager'); $data->key($blog_id); } $data->data( modulesets ); $data->save or die $data->errstr;
Order control MT->add_callback('CMSPostEntrySave',  9 , $rightfields, amp;CMSPostEntrySave); MT->add_callback('CMSPreSave_entry',  9 , $rightfields, amp;CMSPreSave_entry); MT::Entry->add_callback('pre_remove',  9 , $rightfields, amp;entry_pre_remove); Defined in plugins.  No Control on users end
Conclusion Flat-files vs. Modules

Recommended for you

Flat-files: ☺  Easy to install (Just grab it) ☻  Hard to upgrade OK for simple plugins
Modules: ☺  Full-access to Perl OO goodness ☺  Avoid duplicate efforts of CPAN  ☻  Might be hard to resolve deps. Subversion to the rescue (could be a barrier for newbies)
Nice-to-haves: Order control Temporarily disable plugins Per plugin config Per plugin storage
Resources Class::Trigger http:// search.cpan.org /dist/Class-Trigger/ Module::Pluggable http:// search.cpan.org /dist/Module-Pluggable/ Ask Bjorn Hansen: Build Easily Extensible Perl Programs http://conferences.oreillynet.com/cs/os2005/view/e_sess/6806 qpsmtpd http:// smtpd.develooper.com / MT plugins http:// www.sixapart.com/pronet/plugins / Kwiki http:// www.kwiki.org / Plagger http:// plagger.org /

Recommended for you

More Related Content

What's hot

Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
Eric Palakovich Carr
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
Dave Cross
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
Dougal Campbell
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
Ronald Huereca
 
Django a whirlwind tour
Django   a whirlwind tourDjango   a whirlwind tour
Django a whirlwind tour
Brad Montgomery
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
drupalindia
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
Perl Careers
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
Jacob Kaplan-Moss
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
Justin Ryan
 
Ant
Ant Ant
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
Matthias Noback
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
Jim Yeh
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP
King Foo
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
Elizabeth Smith
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
Hannes Hapke
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Getting modern with logging via log4perl
Getting modern with logging via log4perlGetting modern with logging via log4perl
Getting modern with logging via log4perl
Dean Hamstead
 

What's hot (20)

Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
 
Django a whirlwind tour
Django   a whirlwind tourDjango   a whirlwind tour
Django a whirlwind tour
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
Ant
Ant Ant
Ant
 
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
 
Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
Implementing Comet using PHP
Implementing Comet using PHPImplementing Comet using PHP
Implementing Comet using PHP
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Getting modern with logging via log4perl
Getting modern with logging via log4perlGetting modern with logging via log4perl
Getting modern with logging via log4perl
 

Similar to Writing Pluggable Software

Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
olegmmiller
 
Quality Use Of Plugin
Quality Use Of PluginQuality Use Of Plugin
Quality Use Of Plugin
Yasuo Harada
 
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids
Tudor Constantin
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
Alexis Sukrieh
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
Ralph Schindler
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
diego_k
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
Kar Juan
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
Sven Haiges
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
James Williams
 
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Jon Peck
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl Dancer
Alexis Sukrieh
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
brynary
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
aasarava
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs
andrewnacin
 
非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki
keroyonn
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
Robin Fernandes
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
Amzad Hossain
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
Gordon Forsythe
 

Similar to Writing Pluggable Software (20)

Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
Quality Use Of Plugin
Quality Use Of PluginQuality Use Of Plugin
Quality Use Of Plugin
 
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
 
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl Dancer
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs
 
非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki非同期処理の通知処理 with Tatsumaki
非同期処理の通知処理 with Tatsumaki
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 

More from Tatsuhiko Miyagawa

Carton CPAN dependency manager
Carton CPAN dependency managerCarton CPAN dependency manager
Carton CPAN dependency manager
Tatsuhiko Miyagawa
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
Tatsuhiko Miyagawa
 
Plack at OSCON 2010
Plack at OSCON 2010Plack at OSCON 2010
Plack at OSCON 2010
Tatsuhiko Miyagawa
 
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010
Tatsuhiko Miyagawa
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
Tatsuhiko Miyagawa
 
CPAN Realtime feed
CPAN Realtime feedCPAN Realtime feed
CPAN Realtime feed
Tatsuhiko Miyagawa
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEventAsynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
Tatsuhiko Miyagawa
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Remedie OSDC.TW
Remedie OSDC.TWRemedie OSDC.TW
Remedie OSDC.TW
Tatsuhiko Miyagawa
 
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
Tatsuhiko Miyagawa
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
Tatsuhiko Miyagawa
 
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LTWeb::Scraper for SF.pm LT
Web::Scraper for SF.pm LT
Tatsuhiko Miyagawa
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
Tatsuhiko Miyagawa
 
Web::Scraper
Web::ScraperWeb::Scraper
Web::Scraper
Tatsuhiko Miyagawa
 
XML::Liberal
XML::LiberalXML::Liberal
XML::Liberal
Tatsuhiko Miyagawa
 
Test::Base
Test::BaseTest::Base
Test::Base
Tatsuhiko Miyagawa
 
Hacking Vox and Plagger
Hacking Vox and PlaggerHacking Vox and Plagger
Hacking Vox and Plagger
Tatsuhiko Miyagawa
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
Tatsuhiko Miyagawa
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher
Tatsuhiko Miyagawa
 

More from Tatsuhiko Miyagawa (20)

Carton CPAN dependency manager
Carton CPAN dependency managerCarton CPAN dependency manager
Carton CPAN dependency manager
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
 
Plack at OSCON 2010
Plack at OSCON 2010Plack at OSCON 2010
Plack at OSCON 2010
 
cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010cpanminus at YAPC::NA 2010
cpanminus at YAPC::NA 2010
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 
CPAN Realtime feed
CPAN Realtime feedCPAN Realtime feed
CPAN Realtime feed
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Asynchronous programming with AnyEvent
Asynchronous programming with AnyEventAsynchronous programming with AnyEvent
Asynchronous programming with AnyEvent
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQueryBuilding a desktop app with HTTP::Engine, SQLite and jQuery
Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Remedie OSDC.TW
Remedie OSDC.TWRemedie OSDC.TW
Remedie OSDC.TW
 
Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008Why Open Matters It Pro Challenge 2008
Why Open Matters It Pro Challenge 2008
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Web::Scraper for SF.pm LT
Web::Scraper for SF.pm LTWeb::Scraper for SF.pm LT
Web::Scraper for SF.pm LT
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Web::Scraper
Web::ScraperWeb::Scraper
Web::Scraper
 
XML::Liberal
XML::LiberalXML::Liberal
XML::Liberal
 
Test::Base
Test::BaseTest::Base
Test::Base
 
Hacking Vox and Plagger
Hacking Vox and PlaggerHacking Vox and Plagger
Hacking Vox and Plagger
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher
 

Recently uploaded

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 

Recently uploaded (20)

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 

Writing Pluggable Software

  • 1. Writing Pluggable Software Tatsuhiko Miyagawa [email_address] Six Apart, Ltd. / Shibuya Perl Mongers YAPC::Asia 2007 Tokyo
  • 2. For non-JP attendees … If you find in the code, Replace that with backslash. (This is MS' fault)
  • 5. Pl u ggable Software
  • 7. #1 How to make your app pluggable
  • 8. #2 TMTOWTDP There's More Than One Way To Deploy Plugins Pros/Cons by examples
  • 11. #1 Keep the app design and code simple
  • 12. #2 Let the app users customize the behavior (without hacking the internals)
  • 13. #3 It's fun to write plugins for most hackers (see: Plagger and Kwiki)
  • 14. "Can your app do XXX?" "Yes, by plugins."
  • 15. "Your app has a bug in YYY" "No, it's the bug in plugin YYY, Not my fault." (Chain Of Responsibilities)
  • 17. #1 Make your app pluggable
  • 20. grep –r for programmers
  • 21. Ack is a "full-stack" software now.
  • 22. By "full-stack" I mean: Easy install No configuration No way to extend
  • 23. Specifically: These are hardcoded Ignored directories Filenames and types
  • 24. Ignored Directories @ignore_dirs = qw( blib CVS RCS SCCS .svn _darcs .git );
  • 25. Filenames and languages mapping %mappings = ( asm => [qw( s S )], binary => …, cc => [qw( c h xs )], cpp => [qw( cpp m h C H )], csharp => [qw( cs )], … perl => [qw( pl pm pod tt ttml t )], … );
  • 26. What if making these pluggable?
  • 28. Don't get me wrong Andy, I love ack the way it is… Just thought it can be a very good example for the tutorial.
  • 29. Quickstart: Class::Trigger Module::Pluggable © Six Apart Ltd. Employees
  • 30. Class::Trigger SYNOPSIS package Foo; use Class::Trigger; sub foo { my $self = shift; $self->call_trigger('before_foo'); # some code ... $self->call_trigger('after_foo'); } package main; Foo->add_trigger(before_foo => amp;sub1); Foo->add_trigger(after_foo => amp;sub2);
  • 31. Class::Trigger Helps you to implement Observer Pattern. (Rails calls this Observer)
  • 32. Module::Pluggable SYNOPSIS package MyClass; use Module::Pluggable; use MyClass; my $mc = MyClass->new(); # returns the names of all plugins installed under MyClass::Plugin::* my @plugins = $mc->plugins(); package MyClass::Plugin::Foo; sub new { … } 1;
  • 33. Setup plugins in App::Ack package App::Ack; use Class::Trigger; use Module::Pluggable require => 1; __PACKAGE__->plugins;
  • 34. Setup plugins in App::Ack package App::Ack; use Class::Trigger; use Module::Pluggable require => 1 ; __PACKAGE__->plugins; # "requires" modules
  • 35. Ignored Directories (Before) @ignore_dirs = qw( blib CVS RCS SCCS .svn _darcs .git );
  • 36. Ignored Directories (After) # lib/App/Ack.pm __PACKAGE__->call_trigger(' ignore_dirs.add ', ignore_dirs);
  • 37. Ignored Directories (plugins) # lib/App/Ack/Plugin/IgnorePerlBuildDir.pm package App::Ack::Plugin::IgnorePerlBuildDir; App::Ack->add_trigger( " ignore_dirs.add " => sub { my($class, $ignore_dirs) = @_; push @$ignore_dirs, qw( blib ); }, ); 1;
  • 38. Ignored Directories (plugins) # lib/App/Ack/Plugin/IgnoreSourceControlDir.pm package App::Ack::Plugin::IgnoreSourcdeControlDir; App::Ack->add_trigger( " ignore_dirs.add " => sub { my($class, $ignore_dirs) = @_; push @$ignore_dirs, qw( CVS RCS .svn _darcs .git ); }, ); 1;
  • 39. Filenames and languages (before) %mappings = ( asm => [qw( s S )], binary => …, cc => [qw( c h xs )], cpp => [qw( cpp m h C H )], csharp => [qw( cs )], … perl => [qw( pl pm pod tt ttml t )], … );
  • 40. Filenames and languages (after) # lib/App/Ack.pm __PACKAGE__->call_trigger('mappings.add', mappings);
  • 41. Filenames and languages (plugins) package App::Ack::Plugin::MappingCFamily; use strict; App::Ack->add_trigger( "mappings.add" => sub { my($class, $mappings) = @_; $mappings->{asm} = [qw( s S )]; $mappings->{cc} = [qw( c h xs )]; $mappings->{cpp} = [qw( cpp m h C H )]; $mappings->{csharp} = [qw( cs )]; $mappings->{css} = [qw( css )]; }, ); 1;
  • 42. Works great with few lines of code!
  • 43. Now it's time to add Some useful stuff.
  • 45. sub _search { my $fh = shift; my $is_binary = shift; my $filename = shift; my $regex = shift; my %opt = @_; if ($is_binary) { my $new_fh; App::Ack->call_trigger('filter.binary', $filename, new_fh); if ($new_fh) { return _search($new_fh, 0, $filename, $regex, @_); } }
  • 46. Example: Search PDF content with ack
  • 47. PDF filter plugin package App::Ack::Plugin::ExtractContentPDF; use strict; use CAM::PDF; use File::Temp; App::Ack->add_trigger( 'mappings.add' => sub { my($class, $mappings) = @_; $mappings->{pdf} = [qw(pdf)]; }, );
  • 48. PDF filter plugin (cont.) App::Ack->add_trigger( 'filter.binary' => sub { my($class, $filename, $fh_ref) = @_; if ($filename =~ /pdf$/) { my $fh = File::Temp::tempfile; my $doc = CAM::PDF->new($file); my $text; for my $page (1..$doc->numPages){ $text .= $doc->getPageText($page); } print $fh $text; seek $$fh, 0, 0; $$fh_ref = $fh; } }, );
  • 49. PDF search > ack --type=pdf Audrey yapcasia2007-pugs.pdf:3:Audrey Tang
  • 50. Homework Use File::Extract To handle arbitrary media files
  • 51. Homework 2: Search non UTF-8 files (hint: use Encode::Guess) You'll need another hook.
  • 52. Summary Class::Trigger + Module::Pluggable = Pluggable app easy
  • 53. #2 TMTOWTDP There's More Than One Way To Deploy Plugins
  • 54. Module::Pluggable + Class::Trigger = Simple and Nice but has limitations
  • 55. In Reality, we need more control over how plugins behave
  • 56. 1) The order of plugin executions
  • 57. 2) Per user configurations for plugins
  • 58. 3) Temporarily Disable plugins Should be easy
  • 59. 4) How to install & upgrade plugins
  • 60. 5) Let plugins have storage area
  • 62. Examples: Kwiki Plagger qpsmtpd Movable Type
  • 63. I won't talk about Catalyst plugins (and other framework thingy)
  • 64. Because they're NOT "plug-ins"
  • 65. Install plugins And now you write MORE CODE
  • 66. 95% of Catalyst plugins Are NOT "plugins" But "components" 95% of these statistics is made up by the speakers.
  • 68. Kwiki Plugin code package Kwiki::URLBL; use Kwiki::Plugin -Base ; use Kwiki::Installer -base; const class_id => 'urlbl'; const class_title => 'URL Blacklist DNS'; const config_file => 'urlbl.yaml'; sub register { require URI::Find; my $registry = shift; $registry->add(hook => 'edit:save', pre => 'urlbl_hook'); $registry->add(action => 'blacklisted_url'); }
  • 69. Kwiki Plugin (cont.) sub urlbl_hook { my $hook = pop; my $old_page = $self->hub->pages->new_page($self->pages->current->id); my $this = $self->hub->urlbl; my @old_urls = $this->get_urls($old_page->content); my @urls = $this->get_urls($self->cgi->page_content); my @new_urls = $this->get_new_urls(old_urls, urls); if (@new_urls && $this->is_blocked(new_urls)) { $hook->cancel(); return $self->redirect("action=blacklisted_url"); } }
  • 70. Magic implemented in Spoon(::Hooks)
  • 71. "Install" Kwiki Plugins # order doesn't matter here (according to Ingy) Kwiki::Display Kwiki::Edit Kwiki::Theme::Basic Kwiki::Toolbar Kwiki::Status Kwiki::Widgets # Comment out (or entirely remove) to disable # Kwiki::UnnecessaryStuff
  • 72. Kwiki plugin config # in Kwiki::URLBL plugin __config/urlbl.yaml__ urlbl_dns: sc.surbl.org, bsb.spamlookup.net, rbl.bulkfeeds.jp # config.yaml urlbl_dns: myowndns.example.org
  • 73. Kwiki plugins are CPAN modules
  • 74. Install and Upgrade plugins cpan> install Kwiki::SomeStuff
  • 75. Using CPAN as a repository Pros #1: reuse most of current CPAN infrastructure.
  • 76. Using CPAN as a repository Pros #2: Increasing # of modules = good motivation for Perl hackers
  • 77. Cons #1: Installing CPAN deps could be a mess (especially for Win32)
  • 78. Cons #2: Whenever Ingy releases new Kwiki, lots of plugins just break.
  • 79. Kwiki plugin storage return if grep {$page->id} @{$self-> config->cached_display_ignore }; my $html = io->catfile( $self-> plugin_directory ,$page->id )->utf8;
  • 82. Except: plugins are now in SVN repository
  • 83.  
  • 84. Plagger plugin package Plagger::Plugin::Publish::iCal; use strict; use base qw( Plagger::Plugin ); use Data::ICal; use Data::ICal::Entry::Event; use DateTime::Duration; use DateTime::Format::ICal; sub register { my($self, $context) = @_; $context-> register_hook ( $self, ' publish.feed ' => amp;publish_feed, ' plugin.init ' => amp;plugin_init, ); }
  • 85. Plagger plugin (cont) sub plugin_init { my($self, $context) = @_; my $dir = $self->conf->{dir}; unless (-e $dir && -d _) { mkdir $dir, 0755 or $context->error("Failed to mkdir $dir: $!"); } }
  • 86. Plagger plugin storage $self->conf->{invindex} ||= $self-> cache->path_to ('invindex');
  • 87. Plagger plugin config # The order matters in config.yaml # if they're in the same hooks plugins: - module: Subscription::Config config: feed: - http://www.example.com/ - module: Filter::DegradeYouTube config: dev_id: XYZXYZ - module: Publish::Gmail disable: 1
  • 88. Plugins Install & Upgrade cpan> notest install Plagger # or … > svn co http://…/plagger/trunk plagger > svn update
  • 89. Plagger impl. ripped off by many apps now
  • 91. mod_perl for SMTP Runs with tcpserver, forkserver or Danga::Socket standalone
  • 92. Plugins: Flat files rock:/home/miyagawa/svn/qpsmtpd> ls -F plugins async/ greylisting auth/ hosts_allow check_badmailfrom http_config check_badmailfromto ident/ check_badrcptto logging/ check_badrcptto_patterns milter check_basicheaders parse_addr_withhelo check_earlytalker queue/ check_loop quit_fortune check_norelay rcpt_ok check_relay relay_only check_spamhelo require_resolvable_fromhost content_log rhsbl count_unrecognized_commands sender_permitted_from dns_whitelist_soft spamassassin dnsbl tls domainkeys tls_cert* dont_require_anglebrackets virus/
  • 93. qpsmtpd plugin sub hook_mail { my ($self, $transaction, $sender, %param) = @_; my @badmailfrom = $self->qp->config ("badmailfrom") or return (DECLINED); for my $bad (@badmailfrom) { my $reason = $bad; $bad =~ s/^*(+).*/$1/; next unless $bad; $transaction->notes('badmailfrom', $reason) … } return (DECLINED); }
  • 94. Actually qpsmtpd Plugins are "compiled" to modules
  • 95. my $eval = join("", "package $package;", 'use Qpsmtpd::Constants;', "require Qpsmtpd::Plugin;", 'use vars qw(@ISA);', 'use strict;', '@ISA = qw(Qpsmtpd::Plugin);', ($test_mode ? 'use Test::More;' : ''), "sub plugin_name { qq[$plugin] }", $line, $sub, "", # last line comment without newline? ); $eval =~ m/(.*)/s; $eval = $1; eval $eval; die "eval $@" if $@;
  • 96. qpsmtpd plugin config rock:/home/miyagawa/svn/qpsmtpd> ls config.sample/ config.sample: IP logging require_resolvable_fromhost badhelo loglevel rhsbl_zones badrcptto_patterns plugins size_threshold dnsbl_zones rcpthosts tls_before_auth invalid_resolvable_fromhost relayclients tls_ciphers
  • 97. config/plugins # content filters virus/klez_filter # rejects mails with a SA score higher than 2 spamassassin reject_threshold 20
  • 98. config/badhelo # these domains never uses their domain when greeting us, so reject transactions aol.com yahoo.com
  • 99. Install & Upgrade plugins Just use subversion
  • 100.  
  • 101. MT plugins are flat-files (or scripts that call modules)
  • 102. MT plugin code package MT::Plugin::BanASCII; our $Method = "deny"; use MT; use MT::Plugin; my $plugin = MT::Plugin->new({ name => "BanASCII v$VERSION", description => "Deny or moderate ASCII or Latin-1 comment", }); MT->add_plugin($plugin); MT->add_callback('CommentFilter', 2, $plugin, amp;handler);
  • 103. MT plugin code (cont) sub init_app { my $plugin = shift; $plugin->SUPER::init_app(@_); my($app) = @_; return unless $app->isa('MT::App::CMS'); $app-> add_itemset_action ({ type => 'comment', key => 'spam_submission_comment', label => 'Report SPAM Comment(s)', code => sub { $plugin->submit_spams_action('MT::Comment', @_) }, } );
  • 104.  
  • 105.  
  • 106. MT plugin storage require MT::PluginData; my $data = MT::PluginData->load({ plugin => 'sidebar-manager', key => $blog_id }, ); unless ($data) { $data = MT::PluginData->new; $data->plugin('sidebar-manager'); $data->key($blog_id); } $data->data( modulesets ); $data->save or die $data->errstr;
  • 107. Order control MT->add_callback('CMSPostEntrySave', 9 , $rightfields, amp;CMSPostEntrySave); MT->add_callback('CMSPreSave_entry', 9 , $rightfields, amp;CMSPreSave_entry); MT::Entry->add_callback('pre_remove', 9 , $rightfields, amp;entry_pre_remove); Defined in plugins. No Control on users end
  • 109. Flat-files: ☺ Easy to install (Just grab it) ☻ Hard to upgrade OK for simple plugins
  • 110. Modules: ☺ Full-access to Perl OO goodness ☺ Avoid duplicate efforts of CPAN ☻ Might be hard to resolve deps. Subversion to the rescue (could be a barrier for newbies)
  • 111. Nice-to-haves: Order control Temporarily disable plugins Per plugin config Per plugin storage
  • 112. Resources Class::Trigger http:// search.cpan.org /dist/Class-Trigger/ Module::Pluggable http:// search.cpan.org /dist/Module-Pluggable/ Ask Bjorn Hansen: Build Easily Extensible Perl Programs http://conferences.oreillynet.com/cs/os2005/view/e_sess/6806 qpsmtpd http:// smtpd.develooper.com / MT plugins http:// www.sixapart.com/pronet/plugins / Kwiki http:// www.kwiki.org / Plagger http:// plagger.org /