Skip to content

Instantly share code, notes, and snippets.

View ghandmann's full-sized avatar
🐢
jump and touch the sky

Sven Eppler ghandmann

🐢
jump and touch the sky
View GitHub Profile
@ghandmann
ghandmann / Websocket_Error_Handling
Last active August 29, 2015 14:02
Fatal errors in Event-Handlers only emit a finish-event with errorcode 1006
#!/usr/bin/env perl
use Mojo::Base -strict;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new();
$ua->on(error => sub {
my ($ua, $error) = @_;
warn "[ERROR] $error";
});
@ghandmann
ghandmann / gist:2d739205952a30d37ef6
Created August 26, 2014 06:45
Mojo::Util url_escape and unicode characters
#!/usr/bin/env perl
use strict;
use warnings;
use 5.10.0;
use Mojo::Util qw/url_escape/;
my $snowman = "\N{U+2603}";
say url_escape($snowman); # says %2603
@ghandmann
ghandmann / test.pl
Created July 24, 2017 20:26
Mojo::UserAgent async get request to unknown host error handling
use Mojo::Base -strict;
use Mojolicious;
use Mojo::UserAgent;
use Try::Tiny;
say "Mojolicious Version $Mojolicious::VERSION";
my $ua = Mojo::UserAgent->new();
my $requestCallback = sub {
@ghandmann
ghandmann / eventstore-docker-port-web-ui.md
Created January 27, 2020 12:32
Accessing EventStore WebUI Docker on different port

When running EventStore inside a docker container, you may want to change the "outside" listenting port. This can be done easyil with docker and the port options.

But the EventStore WebUI will not respect these changes, since it does not know, that the "outside" port is different. Resulting in broken URLs generated by the EventStore WebUI which point to the default port 2113.

You can change this by setting both the EVENTSTORE_EXT_HTTP_PORT and EVENTSTORE_EXT_HTTP_PORT_ADVERTISE_AS environment variable when starting the docker container:

docker run -it --rm \
	-e EVENTSTORE_EXT_HTTP_PORT=9999 \
	-e EVENTSTORE_EXT_HTTP_PORT_ADVERTISE_AS=9999 \
 -p 9999:2113 -p 1113:1113 eventstore/eventstore