Skip to content

Instantly share code, notes, and snippets.

use v5.24;
use warnings;
my $message = 'this is a log message endofmessage;dept_id=neteng';
my $trunc = $message =~ s/\s*;?(?:[^=;\s]+=[^;=\s]+(?:[ ;]|$))+//r;
say "Message: $message";
say "Trunc: $trunc";
127.0.0.1:6379> hget ticket:1949250 _request_timestamp
"1516910939"
127.0.0.1:6379> multi
OK
127.0.0.1:6379> watch ticket:1949250
(error) ERR WATCH inside MULTI is not allowed
127.0.0.1:6379> discard
OK
127.0.0.1:6379> watch ticket:1949250
OK
@preaction
preaction / inc10.js
Last active January 5, 2018 22:57 — forked from DLSteve/inc10.js
Increment Every 10
var nodes = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ];
for (var i = 0; i < nodes.length; i+=10) {
for ( var j = 0; j < 10 && i+j < nodes.length; j++ ) {
console.log( 'i:' + i + ' j:' + j + ' i+j:' + ( i + j ) );
}
}
@preaction
preaction / test.pl
Last active December 19, 2017 20:54
use Mojolicious::Lite;
use Mojo::Asset::File;
use Alien::SwaggerUI;
use File::Spec::Functions qw( catfile );
get '/docs/*path' => { path => 'index.html' }, sub {
my ( $c ) = @_;
# Redirect so that trailing / helps browser build URLs and
# we have our spec loaded. Can't make its own route because
# the trailing `/` is optional in Mojolicious's route
mysql> select * from release_summary where uploadid = 257874;
+-------------------------------------+---------+----------+--------------------------------------+--------+---------+---------+---------+------+------+------+---------+----------+
| dist | version | id | guid | oncpan | distmat | perlmat | patched | pass | fail | na | unknown | uploadid |
+-------------------------------------+---------+----------+--------------------------------------+--------+---------+---------+---------+------+------+------+---------+----------+
| Log-Dispatch-Scribe | 0.05 | 72845160 | 871570d0-72d6-11e6-87fd-ef1f6f1c15c2 | 1 | 1 | 2 | 1 | 11 | 9 | 0 | 0 | 257874 |
| CMS-Drupal-Modules-MembershipEntity | 0.96 | 67390109 | 5ddb7101-6c0c-1014-839c-59612b99e85d | 1 | 1 | 2 | 1 | 5 | 0 | 0 | 0 | 257874 |
+-------------------------------------+---------+--------
@preaction
preaction / output.txt
Created November 20, 2017 05:58
Output of cpan/DB_File/t/db-hash.t
$ ./perl -I. -MTestInit cpan/DB_File/t/db-hash.t
Use of uninitialized value $value in string eq at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $values[0] in string eq at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $value in lc at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $h{""} in string eq at cpan/DB_File/t/db-hash.t line 243.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
This file has been truncated, but you can view the full file.
Use of uninitialized value $value in string eq at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $values[0] in string eq at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $value in lc at cpan/DB_File/t/db-hash.t line 224.
Use of uninitialized value $h{""} in string eq at cpan/DB_File/t/db-hash.t line 243.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at cpan/DB_File/t/db-hash.t line 252.
@preaction
preaction / build-test-api-file.sh
Created November 16, 2017 22:46
Build a small test file from the CPAN Testers API for testing
#!/bin/bash
cd `dirname "$0"`
cd ..
url=http://api.cpantesters.org/v3/release
in=t/var/tmp/cpantesters-release-api.json
out=t/var/cpantesters-release-api-fake.json
download_original () {

Title on

Two lines