Skip to content

Instantly share code, notes, and snippets.

Joel Berger jberger

Block or report user

Report or block jberger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:93c719cf9e50ff41fbcdbfc88fb5e399
<jberger> so as people are assembling for PTS (which I sadly am not able to attend this year) I want to float an idea that I've been thinking a lot about
and it specifically derives from building out the CI/CD system we're using at $work
I'd like there to be some way to delegate the module version to the META file
this is handy because I can build a darkpan dist and not need to modify the code in order to do so (if the version isn't in the code)
but it also gives us some other nice perks
no need to statically parse the version out of the code
and an opportunity to newer/better enforce standards on versions declared in this way
I'd see it as opt in in the module probably
use VersionFromMETA 'Distname'; or some such
we'd have to have tooling that would make the meta available obviously
View audio.log
17:24:25.044 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
17:24:25.300 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/configuration/mycroft.conf loaded
17:24:25.542 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
17:24:25.777 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /home/mycroft/.mycroft/mycroft.conf loaded
17:24:26.037 - mycroft.identity:_load:44 - DEBUG - Loading identity
17:24:26.052 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
17:24:26.438 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/059a2be3-6160-4300-844e-791345f0e74e HTTP/1.1" 200 476
17:24:26.683 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /opt/venvs/mycroft-core/lib/
View app.psgi
use Dancer2;
set template => 'simple';
set views => '.';
any '/text' => sub {
my $name = param('name') // 'world';
send_as plain => "hello $name";
};
@jberger
jberger / version.pl
Last active Nov 27, 2018
a VERSION method that checks for major version number as well as minimum version
View version.pl
use strict;
use warnings;
{
package MyPackage;
use version;
use Carp ();
our $VERSION = '2.01';
View ably.pl
# Developed using:
# https://www.ably.io/documentation/client-lib-development-guide
# https://docs.ably.io/client-lib-development-guide/
# This PoC code is released under the terms of the Artistic 2.0 license
# Copyright (c) 2018 by Joel Berger
use Mojo::Base -strict, -signatures;
use Mojo::Promise;
use Mojo::UserAgent;
View test.pl
use Mojo::Base -strict;
use Test::More;
use Carp ();
use Mojo::Promise;
sub await;
sub async {
my $body = shift;
View log_context.pl
use Mojolicious::Lite -signatures;
use Mojo::JSON 'to_json';
use Scalar::Util 'weaken';
{
package Mojo::Log::WithContext;
use Mojo::Base 'Mojo::Log';
has context => sub { {} };
}
View promise_from_event.pl
use Mojo::Base -strict;
use Mojo::Util 'dumper';
use Mojo::Promise;
use Mojo::EventEmitter;
use Mojo::IOLoop;
sub promise_from_event {
my ($emitter, $success, $error) = @_;
my $p = Mojo::Promise->new;
View dist.pl
use strict;
use warnings;
use Archive::Tar;
use CPAN::Meta;
use ExtUtils::Manifest qw/mkmanifest maniread/;
use Module::CPANfile;
use Module::Metadata;
use Module::Build::Tiny ();
use Time::Piece;
View fetcher.js
export function Fetcher (options) {
if (options.base) this.base = options.base;
};
Fetcher.prototype.fetch = function(input, init) {
if (input instanceof Request) {
return window.fetch(input, init);
}
let url = this.base ? new URL(input, this.base) : new URL(input);
You can’t perform that action at this time.