Skip to content

Instantly share code, notes, and snippets.

View yko's full-sized avatar

Yaroslav Korshak yko

  • Plaid
  • Amsterdam, The Netherlands
View GitHub Profile
@yko
yko / srsly.pl
Last active August 29, 2015 14:03
use utf8;
use Carp ();
sub ಠ_ಠ { local $Carp::CarpLevel = 1; &Carp::carp }
ಠ_ಠ "Srsly?";
@yko
yko / test.sh
Last active August 29, 2015 14:11
http_proxy= curl -X POST -H "content-type: application/json" \
http://localhost:8098/mapred --data @-<<\EOF
{"inputs":[["welcome","german"]]
,"query":[{"map":{"language":"perl","source":"
sub {
my ($m) = lc(shift->{values}[0]{data}) =~ /(\w*)/;
my @r
for my $i (@$m) {
if($i ne '') {
push @r, { $i => 1 };
my $kw = $r->route('/keywords')
->to(controller => 'stats', action => 'keywords')
->name('keywords');
my $kwid = $kw->waypoint('/:id', id => qr/\d+/)
->to('action' => 'keyword_stats')
->name('keyword stats');
#!/usr/bin/perl
use strict;
use warnings;
use Mojo::Client;
my $client = Mojo::Client->new( max_redirects => 3 );
my @urls = qw(http://bash.org http://autocentre.ua);
<?xml version="1.0" encoding="iso-8859-1" ?>
<tests version="1.0">
<group>
<item>4</item>
<item>2</item>
<item>1</item>
</group>
<group>
<item>4</item>
#!/usr/bin/perl
use strict;
use warnings;
my $str = shift @ARGV;
if ($str =~ /(|\d+?)((?:(?:2[1..5][1..5]|1?\d?\d)\.){3}(?:2[1..5][1..5]|1?\d?\d))/) {
if ($1) { warn "Strange ip: $&" }
sub build_tx {
my ($self, $user, $pass) = @_;
croak("Basic authorization user name can't contain ':'")
if $user =~ /:/;
# or build_tx('POST|GET|...', ...), see Mojo::Client
my ($tx, $cb) = $self->client->build_form_tx($url, {
field => 'value',
# ...
Testing gist.vim
-- Updating gist with vim
eeeee
Lalala