This file contains hidden or 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
String found where operator expected at test.pl line 14, near "dosomething 'test'" | |
(Do you need to predeclare dosomething?) | |
syntax error at test.pl line 14, near "dosomething 'test'" | |
Execution of test.pl aborted due to compilation errors. |
This file contains hidden or 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 MooseRole; | |
use Moose::Role; | |
sub dosomething { | |
my ($field, %args) = @_; | |
my $package = caller; | |
use Data::Dumper; | |
print Dumper $package->meta->get_attribute($field); | |
} |
This file contains hidden or 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 | |
use Mojolicious::Lite; | |
my $r = app->routes; | |
$r->get('/')->to(cb => sub { | |
my $self = shift; | |
$self->render(text => 'test'); | |
}); | |
my $b = $r->bridge('/#arg1/#arg2')->to(cb => sub { |
This file contains hidden or 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
use Mango; | |
use strict; | |
use warnings; | |
print "Mango version: $Mango::VERSION\n"; | |
my $mango = Mango->new($ENV{MANGO_URI} // "mongodb://localhost:27017"); | |
my $db = $mango->db('test_db'); | |
my $collection = $db->collection('test_collection'); |
This file contains hidden or 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
$r->bridge('/:something')->to(cb => sub { | |
my $something = shift->stash('something'); | |
my $type = type_of_something($something); | |
if($type eq 'girl') { | |
# route to foo#bar | |
} elsif ($type eq 'boy') { | |
# route to baz/qux | |
} | |
}); |
This file contains hidden or 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 | |
BEGIN { | |
$ENV{'HTTP_PROXY'} = '<INSERT PROXY>'; | |
$ENV{'HTTPS_PROXY'} = '<INSERT PROXY>'; | |
$ENV{'MOJO_PROXY'} = 1; | |
$ENV{'MOJO_USERAGENT_DEBUG'} = 1; | |
} | |
use Mojolicious::Lite; |
This file contains hidden or 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 wrappers | |
import play.api._ | |
import play.api.mvc._ | |
import scala.concurrent._ | |
import scala.concurrent.Future | |
import play.mvc.Http.Status | |
import ExecutionContext.Implicits.global | |
import play.libs.Akka | |
import akka.actor.{Actor, Props} |
This file contains hidden or 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 ReactiveAPI | |
import org.specs2.mutable.Specification | |
import play.api.mvc.{Action, Results} | |
import play.api.test.{WithApplication, FakeApplication} | |
import play.api.cache.Cache | |
class ExampleSpec extends Specification with Results { | |
val appWithRoutes = FakeApplication(withRoutes = { | |
case ("GET", "/") => Action{ Ok } |
This file contains hidden or 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 ReactiveAPI | |
import org.specs2.mutable.Specification | |
import play.api.mvc.{Action, Results} | |
import play.api.test.{WithApplication, FakeApplication} | |
import play.api.cache.Cache | |
class ExampleSpec extends Specification with Results { | |
val app = () => FakeApplication() | |
"Example" should { |
This file contains hidden or 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 ReactiveAPI | |
import org.specs2.mutable.Specification | |
import play.api.mvc.{Action, Results} | |
import play.api.test.{WithApplication, FakeApplication} | |
import play.api.cache.Cache | |
class ExampleSpec extends Specification with Results { | |
val appWithRoutes = () => FakeApplication(withRoutes = { | |
case ("GET", "/") => Action{ Ok } |