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 strict; | |
use warnings; | |
# hydrate: poor man's templating | |
# | |
# usage: hydrate key1=value1 key2=value2 ... path/to/file.in > path/to/file.out | |
# | |
# substitutes all strings '{{key1}}' in file.in with 'value1' |
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 strict; | |
use warnings; | |
use feature 'say'; | |
my %deps = map { $_ => [] } map { chomp; $_ } `brew list`; | |
for my $cask (sort keys %deps) { | |
print STDERR "\r\e[2KInspecting cask: '$cask'"; |
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 Mojo::Base -strict; | |
use Minion; | |
my $minion = Minion->new(Pg => 'postgresql://postgres@/test'); | |
for (1..10) { | |
$minion->enqueue('my-task', [name => "Number $_"], {delay => $_}); | |
say STDERR "Injected $_"; | |
} |
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
$app->plugin(OpenAPI => {url => $app->home->rel_file('schema.yaml'), | |
spec_route_name => 'docs'}); |
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
sub docs { | |
my $c = shift->openapi->valid_input or return; | |
$c->app->routes->lookup('docs')->to->{cb}->($c); | |
} |
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
--- local/lib/perl5/Mojolicious/Plugin/OpenAPI.pm~ 2017-03-02 16:35:26.000000000 -0700 | |
+++ local/lib/perl5/Mojolicious/Plugin/OpenAPI.pm 2017-03-14 09:34:37.000000000 -0600 | |
@@ -223,7 +223,7 @@ | |
local $spec->{id}; | |
delete $spec->{id}; | |
- local $spec->{basePath} = $c->url_for($spec->{basePath}); | |
+# local $spec->{basePath} = $c->url_for($spec->{basePath}); | |
local $spec->{host} = $c->req->url->to_abs->host_port; |
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
--- local/lib/perl5/Mojolicious/Plugin/OpenAPI.pm~ 2017-03-02 16:35:26.000000000 -0700 | |
+++ local/lib/perl5/Mojolicious/Plugin/OpenAPI.pm 2017-03-13 17:45:31.000000000 -0600 | |
@@ -71,6 +71,7 @@ | |
my $spec_route = $route->get->to(cb => \&_reply_spec); | |
if (my $spec_route_name = $config->{spec_route_name} || $api_spec->get('/x-mojo-name')) { | |
$spec_route->name($spec_route_name); | |
+ $spec_route->route($spec_route_name); | |
$route_prefix = "$spec_route_name."; | |
} |
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 Meta; | |
sub docs { | |
my $c = shift->openapi->valid_input or return; | |
$c->respond_to(openapi => $c->openapi->spec(''), any => $c->openapi->spec('')); ## FIXME | |
} | |
1; | |
__DATA__ |
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 Meta; | |
sub docs { | |
my $c = shift->openapi->valid_input or return; | |
$c->render(openapi => $c->openapi->spec('')); | |
} | |
1; | |
__DATA__ |
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
## purpose: | |
## | |
## create a Terrform override file containing temporary role | |
## credentials generated from an account protected with MFA. | |
## | |
## usage: | |
## | |
## $ make credentials aws_override.tf PROFILE=my-profile TOKEN_CODE=123456 | |
## $ terraform apply | |
## |
NewerOlder