Skip to content

Instantly share code, notes, and snippets.

View mishin's full-sized avatar
💭
if you fail to prepare you prepare to fail

Nikolay Mishin mishin

💭
if you fail to prepare you prepare to fail
View GitHub Profile
@mishin
mishin / master.pl
Created December 10, 2015 04:17 — forked from akahan/master.pl
sub run {
my ($self) = @_;
$0 = $self->{procname};
# Создаем процессы слейвов
for my $slave_id (sort {$a <=> $b} keys %{$self->{_respawn_ctl}}) {
debug "Spawning slave: $slave_id";
my $slave = AsyncJobsServer::Slave->new(
@mishin
mishin / cpannti.sh
Created November 15, 2015 12:12 — forked from vifo/cpannti.sh
Perl: "notest install module" from shell using CPAN
#!/bin/sh
# Usage: cpannti.sh <module_names>
# cpan (i.e. App::Cpan) does not provide a direct way to install modules without
# testing them, as you can do in the CPAN shell with:
#
# cpan[1]> notest install FooBarBaz
#
# App::Cpan uses CPAN::Shell under the hood to perform installation, so let's do
import logging
import timeit
logger = logging.getLogger(__name__)
def log_noop():
pass
def log_simple():
logger.info("Testing")
@mishin
mishin / gist:9d396073be6530327291
Created October 13, 2015 06:38 — forked from dfkaye/gist:8849940
install make for mysysgit on windows without re-installing msysgit

close git-bash first

download bin-make.exe

put it in programs (x86)/Git/bin as 'make.exe'.

open git-bash $ cd to a temp or bullpen directory

try it:

@mishin
mishin / genhttplogs.rb
Created October 12, 2015 13:57 — forked from fetep/genhttplogs.rb
apache log generator
#!/usr/bin/ruby
class IPGenerator
public
def initialize(session_count, session_length)
@session_count = session_count
@session_length = session_length
@sessions = {}
end
@mishin
mishin / unzip.pl
Created September 24, 2015 19:15 — forked from eqhmcow/unzip.pl
Perl unzip example with IO::Uncompress::Unzip
#!/usr/bin/perl
# example perl code, this may not actually run without tweaking, especially on Windows
use strict;
use warnings;
=pod
IO::Uncompress::Unzip works great to process zip files; but, it doesn't include a routine to actually
extract an entire zip file.
@mishin
mishin / mojo-crawler.pl
Created September 24, 2015 15:58 — forked from creaktive/mojo-crawler.pl
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@mishin
mishin / MyDB.pm
Created September 24, 2015 12:25 — forked from jacoby/MyDB.pm
package MyDB ;
=head1 NAME
MyDB - Module handling access to MySQL databases
=head2 DESCRIPTION
Mostly used within DB.pm, which handles the actual queries. This handles
connecting to the actual databases.
@mishin
mishin / yapcna2015.wq.pl
Created September 24, 2015 10:59 — forked from jacoby/yapcna2015.wq.pl
Head to head comparison of Mojo::DOM and Web::Query
#!/usr/bin/env perl
use feature qw{ say state unicode_eval unicode_strings } ;
use strict ;
use warnings ;
use utf8 ;
use Data::Dumper ;
use Mojo::DOM ;
use Web::Query ;
#!/usr/bin/env perl
use 5.016;
use common::sense;
use utf8::all;
# Use fast binary libraries
use EV;
use Web::Scraper::LibXML;
use YADA 0.039;