Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mpapec on github.
  • I am mpapec (https://keybase.io/mpapec) on keybase.
  • I have a public key ASB6lo_QxTyVluBbOK1OxGOj_hb_7m31kMrjMp-8jPKrmgo

To claim this, I am signing this object:

module.exports = {
die: function(err) {
let e = new Error();
let frame = e.stack.split("\n")[2];
let arr = frame.split(" ");
// let functionName = arr[5];
let where = arr[6].split(/[:()]/);
let fileName = where[1];
let lineNumber = where[2];
throw (err || "Died").toString().replace(/\w+:\s*/g, '') +" at "+ fileName +" line "+ lineNumber +".";
var EventSourceWrapper = (function() {
"use strict;"
var Class = function (url) {
var that = this;
that.ws = undefined;
that.connected = false;
that.reconnect = 3 *1000;
that.log = undefined;
binmode STDOUT, ":utf8";
{
my @r = ("\x{2080}", "\x{2081}","\x{2082}", "\x{2083}", "\x{2084}", "\x{2085}", "\x{2086}", "\x{2087}", "\x{2088}", "\x{2089}");
sub sscript {
my $num = shift // $_;
my $ret = "";
$num =~ s/(\d)/$r[$1]/g;
return $num;
}}
@mpapec
mpapec / test.pl
Last active September 8, 2016 14:57 — forked from jberger/test.pl
use Mojolicious::Lite;
helper iodelay => sub {
my $cb = pop;
my ($c, @steps) = @_;
push @steps, sub {
# log err if $_[1]
shift;
$c->$cb(@_);
# docker build -t mpapec/convos .
FROM alpine:3.4
MAINTAINER Convos@Mojo
RUN apk update && \
apk add perl perl-io-socket-ssl perl-dev g++ make openssl openssl-dev wget curl && \
curl -L https://goo.gl/kDpvKZ | tar xvz && \
ln -s /convos-stable /convos && \
cd /convos && \
perl script/convos install && \
use 5.20.0;
use Mojolicious::Lite;
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Redis2;
plugin 'DefaultHelpers';
app->config( hypnotoad => {
workers => 5,
# same as morbo
use 5.20.0;
use strict;
use warnings;
use Benchmark qw(:all);
my $i;
my $fa;
my %hash1;
my %hash2;
my %hash3;
use 5.20.0;
use Mojo::UserAgent;
use Mojo::IOLoop;
sub ws_connect {
state $ua;
my $go = sub {
say "Connecting..";
@mpapec
mpapec / .nanorc
Last active August 29, 2015 14:13
## This is a system-wide configuration file for the nano editor.
##
## Each user can save his own configuration to ~/.nanorc
##
## See the nanorc(5) man page for details.
## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in