Skip to content

Instantly share code, notes, and snippets.

Doing this locally:
# trick Moose into building our constructor for us
sub can {
return if $_[1] eq 'new';
return $_[0]->SUPER::can(@_);
}
snobol4 -- Programs written in SNOBOL require a SNOBOL interpreter to run. For some reason, Debian doesn't have any, so I've included the sourceball for one. The install script will attempt to build it and install it into $HOME, and the ./lifter wrapper attempts to use that. The tarball is originally available from http://www.snobol4.org/csnobol4/curr/
<danny_mk> Hello everyone, I know how to run WebGUI8 for one site, however how do I run it for multiple sites.
<haarg> it's not much different from 7
<haarg> it will load all of the config files in etc by default
<danny_mk> I am using = /usr/local/bin/plackup -E none -s Starman --workers 10 --disable-keepalive --port $PORT --pid $PID --daemonize
<haarg> how are you running it for one site?
<danny_mk> where port is a local port that cannot be accessed from the outside
<danny_mk> then in apache ProxyPass / http://localhost:8990/
<danny_mk> ProxyPassReverse / http://localhost:8990/
<danny_mk> of course the site will only know about the "default" site
<danny_mk> I wonder if running it via a socket or PerlSetVar psgi_app /websites/myapp.example.com/app.psgi
#!/usr/bin/perl
package arrays2;
# inspired by http://blog.headius.com/2012/09/avoiding-hash-lookups-in-ruby.html ...
# attempt to use arrays for class instance data in Perl rather than hashes.
# this is done by scanning the bytecode, finding places where the '$self' hash ref
# is accessed, converting the names of the hash subscripts to numbers, changing the
# and hashes to arrays.
# for example, $self->{foo} might be changed to $self->[1].
Macro::AdminToggle passes op=admin
Content::Admin handles that
it also takes plugin=whatever;method=whatever and looks up the class in the 'adminConsole' section of the config file
for the plugin and runs whichever method in there
it defaults to calling the GET specified 'method' in WebGUI::Admin, defaulting to 'www_view'
WebGUI::Admin implements most of the admin, except for extensions
currently, www_view in Admin.pm does, in part:
my $tmpl = WebGUI::Asset::Template->newById( $session, $session->setting->get('templateIdAdmin') );
#!/usr/bin/perl
use strict;
use warnings;
no warnings 'uninitialized';
use Data::Dumper;
use IO::Handle;
use WWW::Workflowy;
#!/usr/local/bin/perl
use strict;
use warnings;
use Test::More;
use Acme::6502;
use lib '.';
#!/usr/bin/perl
package arrays2;
# inspired by http://blog.headius.com/2012/09/avoiding-hash-lookups-in-ruby.html ...
# attempt to use arrays for class instance data in Perl rather than hashes.
# this is done by scanning the bytecode, finding places where the '$self' hash ref
# is accessed, converting the names of the hash subscripts to numbers, changing the
# and hashes to arrays.
# for example, $self->{foo} might be changed to $self->[1].
use Text::Levenshtein::Damerau 'edistance';
my $text = qq{
Linen Finish Cards
I'd like to be able to order higher-quality card stock options, namely linen stock, similar to many playing card brands.
};
my @text = split m/\s+/, $text;
# 59 /data/apps/lib/perl5/site_perl/5.16.2/Dancer/Request.pm_153
# 57 /data/apps/lib/perl5/site_perl/5.16.2/DBIx/Class/SQLMaker.pm_247
# 37 /data/apps/lib/perl5/site_perl/5.16.2/DBIx/Class/Storage/DBI.pm_2395
# 36 /data/apps/lib/perl5/site_perl/5.16.2/DBIx/Class/ResultSet.pm_1272
# 30 /data/apps/lib/perl5/site_perl/5.16.2/x86_64-linux/DBI.pm_1293
# 27 /data/apps/lib/perl5/site_perl/5.16.2/x86_64-linux/DateTime.pm_435
# 18 /data/apps/lib/perl5/site_perl/5.16.2/Dancer/Request.pm_328
# 17 /data/apps/lib/perl5/site_perl/5.16.2/HTTP/Body.pm_107
# 12 /data/apps/lib/perl5/5.16.2/x86_64-linux/Encode.pm_129
# 10 /data/apps/lib/perl5/site_perl/5.16.2/Dancer/Request.pm_432