Skip to content

Instantly share code, notes, and snippets.

View esobchenko's full-sized avatar

Eugen Sobchenko esobchenko

  • Odessa, Ukraine
View GitHub Profile
[LAN access from remote] from 109.162.69.251:44886 to 192.168.1.5:63701 Wednesday, Apr 03,2013 17:35:45
[LAN access from remote] from 95.174.220.144:58116 to 192.168.1.5:41888 Wednesday, Apr 03,2013 17:35:39
[Admin login] from source 192.168.1.2, Wednesday, Apr 03,2013 17:34:57
[LAN access from remote] from 86.121.103.229:27125 to 192.168.1.5:49001 Wednesday, Apr 03,2013 17:34:54
[LAN access from remote] from 91.204.254.125:65269 to 192.168.1.5:56388 Wednesday, Apr 03,2013 17:34:46
[LAN access from remote] from 91.204.254.125:65257 to 192.168.1.5:56388 Wednesday, Apr 03,2013 17:34:45
[LAN access from remote] from 188.255.1.45:63076 to 192.168.1.5:46551 Wednesday, Apr 03,2013 17:34:06
[LAN access from remote] from 188.186.150.229:49328 to 192.168.1.5:48516 Wednesday, Apr 03,2013 17:33:58
[LAN access from remote] from 37.212.90.137:1024 to 192.168.1.5:24940 Wednesday, Apr 03,2013 17:33:36
[LAN access from remote] from 62.140.253.24:21394 to 192.168.1.5:56388 Wednesday, Apr 03,2013 17:33:23
#!/usr/bin/env perl
use Mojolicious::Lite;
hook before_dispatch => sub {
my $self = shift;
$self->app->log->debug("entering 1st before dispatch hook...");
$self->render( text => "stop", status => 300 );
};
my $sorted_results = [
sort
{
( $a, $b ) = ( $b, $a ) if $order eq 'desc';
$a->{$sortby} <=> $b->{$sortby} || $a->{$sortby} cmp $b->{$sortby}
} @$results
];
В. Маяковський "Долг Украине":
... Мы знаем,
курит ли,
пьёт ли Чаплин;
мы знаем
Италии безрукие руины;
мы знаем,
как Ду́гласа
галстух краплен…
А что мы знаем
{
listen => [ 'http://*:3001' ],
workers => 5,
inactivity_timeout => 0,
keep_alive_requests => 300,
};
{ # custom renderer <% include 'foo', handler => 'no' %>
package Mojolicious::Plugin::NoRenderer;
use Mojo::Base 'Mojolicious::Plugin';
use IO::File;
sub register {
my ( $self, $app, $options ) = @_;
$options ||= {};
set nocompatible
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
" allow backspacing over everything in insert mode
set backspace=indent,eol,start "
set hidden
@esobchenko
esobchenko / font-size.html
Created July 26, 2011 13:11
font-size defect for select element
<html>
<head>
<style>
select {
border: solid 1px #ccc;
font-size: 1.5em;
}
</style>
use strict;
use warnings;
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
my @t = grep {"" !~ //} ("what the fuck?!");
push @t, "everything ok";
# we expect "everything ok" here but guess what we get?
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use List::Util qw/reduce/;
use Mojolicious::Lite;