This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
package Probe; | |
use Scalar::Util qw/ set_prototype /; | |
sub create_function { | |
my ($answer) = @_; | |
*Probe::block = sub (&) { | |
shift->($answer); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'grit' | |
commits = ARGV | |
r = Grit::Repo.new('.') | |
commits.each do |commit| | |
c = r.commits(commit).first | |
puts "#> #{c.message}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
import javax.naming.InitialContext | |
import javax.naming.directory.SearchControls | |
import javax.naming.AuthenticationException | |
import javax.naming.CommunicationException | |
module Ldap | |
module JndiLdap | |
# make the SUBTREE_SCOPE constant available | |
SearchControls.field_reader(:SUBTREE_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub enterprises : PathPart('enterprises') Chained('/') ActionClass('REST') { } | |
sub enterprises_GET { | |
my ( $self, $c ) = @_; | |
my @ents_rs = $c->model('ProfileDB::Enterprise')->all(); | |
my @enterprises = map { { uri => $c->uri_for($c->controller->action_for('enterprise'), $_->id)->as_string, | |
id => $_->id, | |
name => $_->name } } @ents_rs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__PACKAGE__->config( | |
name => 'StatsReceiver', | |
'Controller::Stats' => | |
{ | |
superclasses => [qw/Catalyst::Controller::MessageDriven/], | |
}, | |
'Model::Stats' => | |
{ | |
class => 'StatsReceiver::ToCouchDB', | |
interface_roles => [qw/StatsReceiver::StatsMessage/], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[debug] Loaded components: | |
.-----------------------------------------------------------------+----------. | |
| Class | Type | | |
+-----------------------------------------------------------------+----------+ | |
| PaymentApp::Controller::PaymentProvider | instance | | |
| PaymentApp::Controller::PaymentProvider::Null::Dev | instance | | |
| PaymentApp::Controller::PaymentProvider::Null::Unittests | instance | | |
| PaymentApp::Controller::Root | instance | | |
| PaymentApp::Model::PaymentProvider | instance | | |
| PaymentApp::Model::PaymentProvider::Null | class | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ENV{PERL_MM_USE_DEFAULT} = '1'; | |
# cpan2rpm causes these to be set, which makes AutoInstall not install deps. | |
delete $ENV{PERL5_CPAN_IS_RUNNING}; | |
delete $ENV{PERL5_CPANPLUS_IS_RUNNING}; | |
use FindBin; | |
my $sitelib = "$FindBin::Bin/site-lib"; | |
use local::lib '--self-contained', "$FindBin::Bin/site-lib"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chris-andrews-computer:~ chris$ perl foo.pl | |
defaults: | |
foo at foo.pl line 14 | |
main::foo('aaaaaaaaaa', 'bbbbbbbbbb') called at foo.pl line 18 | |
main::bar('aaaaaaaaaa', 'bbbbbbbbbb') called at foo.pl line 5 | |
both set to 1: | |
foo at foo.pl line 14 | |
main::foo('aaaaaaaaaa', 'bbbbbbbbbb', ...) called at foo.pl line 18 | |
main::bar('aaaaaaaaaa', 'bbbbbbbbbb', ...) called at foo.pl line 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
require 'lib/cascading-core-1.1.0-54.jar' | |
require 'lib/cascading-1.1.0-54.jar' | |
require 'lib/hadoop-0.20.0-core.jar' | |
require 'lib/jgrapht-jdk1.6.jar' | |
require 'lib/log4j-1.2.15.jar' | |
require 'lib/commons-logging-1.0.4.jar' | |
require 'lib/commons-logging-api-1.0.4.jar' | |
require 'lib/commons-codec-1.3.jar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# System - Centos 5, RPM perl: | |
perl-5.8.8-18.el5_3.1 | |
# OK: | |
[chris@dev ~]$ /usr/bin/perl -MScalar::Util=weaken -e1 | |
[chris@dev ~]$ | |
# same, but local::libbed, self-contained: | |
[chris@dev ~]$ cat test.pl | |
use local::lib '--self-contained'; |
OlderNewer