Skip to content

Instantly share code, notes, and snippets.

tags title
community
A Community is a Reflection of its Leaders

I've been in charge of a certain community for a very long time. Before my actual tech career started, even. Back when doing websites was just a hobby I didn't want to ruin by getting money involved.

use strict;
use warnings;
no warnings 'experimental::smartmatch';
my $text = <<ENDTEXT;
Řádek pro automatické zpracování:
DOMAINREN|domain.com|2342432|123432424|3242432
ONLINE|stufandssssssssss
ENDTEXT
@preaction
preaction / shell.html
Last active January 9, 2016 21:19
Proposal for shell session highlighting
<pre><samp class="hljs">$ <kbd class="hljs-shell"><span class="hljs-keyword">echo</span> <span class="hljs-string">'hello'</span></kbd>
hello
</samp></pre>
<pre><samp class="hljs">$ <kbd class="hljs-shell"><span class="hljs-keyword">git</span> <span class="hljs-option">-c</span> log <span class="hljs-option">-n2</span></kbd>
<span class="ansi-fg-yellow">commit f12c3c0434f144ee09c0dcfda2a819600baad2a4</span>
Author: Doug Bell <[email protected]>
Date: Fri Jan 8 21:19:39 2016 -0600
add better error message when include not found
cpanm (App::cpanminus) 1.7039 on perl 5.020002 built for x86_64-linux-gnu-thread-multi
Work directory is /home/aaw/aaw_rami/dbell/.cpanm/work/1452024624.42409
You have make /usr/bin/make
You have /usr/bin/wget
You have /bin/tar: tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@preaction
preaction / shell.pl
Last active December 10, 2015 22:22
use Mojolicious::Lite;
use Mojo::IOLoop;
use Mojo::IOLoop::Stream;
websocket '/' => sub {
my ( $c ) = @_;
my ( $stream, $id );
$c->on( message => sub {
tags title
yertl
perl
ygrok - Parse plain text into data structures

As a data warehouse, a significant part of my job involves log analysis. Besides the standard root cause analysis, I need to verify database writes, diagnose user access issues, and look for under-used (and

@preaction
preaction / broker.pl
Last active November 20, 2021 08:10
A simple message broker using Mojolicious WebSockets
#!/usr/bin/env perl
# ABSTRACT: A simple message broker using Mojolicious WebSockets
# USAGE: ./socket.pl daemon
#
# Try the demo and read the explanation on the page before reading the code.
#
# Copyright 2015 Doug Bell (<[email protected]>)
#
# This is free software; you can redistribute it and/or modify it under
# the same terms as the Perl 5 programming language system itself.
foo = [ [ 1, 2, 3 ], [ 2, 4, 6 ], [ 3, 6, 9 ] ]
for [ a, b, c ] in foo:
print a
print b
print c
print "---"
@preaction
preaction / TestDeep.pm
Created August 4, 2015 01:34
Add Test::Deep to Test::Mojo
package Test::Mojo::Role::TestDeep;
# ABSTRACT: Add Test::Deep methods to Test::Mojo::WithRoles
use Role::Tiny;
use Test::Deep qw( cmp_deeply );
sub json_deeply {
my ( $t, $test, $desc ) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
return cmp_deeply( $t->tx->res->json, $test, $desc );