Skip to content

Instantly share code, notes, and snippets.

Akzhan Abdulin akzhan

Block or report user

Report or block akzhan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@akzhan
akzhan / Model.pm
Last active Jun 21, 2017
use JSON schema to validate params
View Model.pm
sub update {
my $self = shift;
my $data = $self->req->json;
return $self->render(
json => {
success => \0,
error => "No data provided",
}
) unless $data;
@akzhan
akzhan / license-badges.md
Last active May 12, 2017 — forked from lukas-h/license-badges.md
License Badges for your Project
View license-badges.md

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
@akzhan
akzhan / moose_dynamic.pl
Last active Apr 19, 2017
moose dynamic
View moose_dynamic.pl
package Cat;
use Moose;
package Generator;
use Mouse::Meta::Class;
use Mouse::Meta::Attribute;
sub generate {
my $siberian = Mouse::Meta::Class->create('Siberian');
@akzhan
akzhan / Redis.pm
Last active Apr 18, 2017
Simple Redis client module
View Redis.pm
package YourCompany::Util::Redis;
use YourCompany::Perl;
use YourCompany::Config ();
BEGIN {
require parent;
eval {
parent->import( 'Redis::Fast' );
@akzhan
akzhan / .perlcriticrc
Last active Apr 4, 2017
YourCompany Perl Prologue
View .perlcriticrc
include = BuiltinFunctions::ProhibitBooleanGrep BuiltinFunctions::ProhibitStringyEval BuiltinFunctions::ProhibitStringySplit BuiltinFunctions::ProhibitUniversalCan BuiltinFunctions::ProhibitUniversalIsa ClassHierarchies::ProhibitExplicitISA CodeLayout::ProhibitHardTabs ControlStructures::ProhibitMutatingListFunctions ControlStructures::ProhibitUnreachableCode ErrorHandling::RequireCarping InputOutput::ProhibitBarewordFileHandles InputOutput::RequireCheckedClose InputOutput::RequireCheckedOpen InputOutput::RequireCheckedSyscalls InputOutput::ProhibitInteractiveTest InputOutput::ProhibitOneArgSelect InputOutput::ProhibitTwoArgOpen Miscellanea::ProhibitFormats Modules::ProhibitEvilModules Modules::RequireEndWithOne Objects::ProhibitIndirectSyntax Policy::TestingAndDebugging::RequireUseStrict Policy::TestingAndDebugging::RequireUseWarnings RegularExpressions::ProhibitCaptureWithoutTest Subroutines::ProhibitBuiltinHomonyms Subroutines::ProhibitReturnSort Subroutines::ProhibitSubroutinePrototypes Subroutines::Prohi
View JSON.pm
package BUX::Util::JSON;
=encoding utf-8
=head1 NAME
BUX::Util::JSON
=head1 SYNOPSYS
@akzhan
akzhan / JSONColumn.pm
Created Dec 28, 2016
BUX::Util::JSONColumn for DBIx::Class
View JSONColumn.pm
package BUX::Util::JSONColumn;
use strict;
use warnings;
use utf8;
use JSON::XS ();
use Encode qw( encode_utf8 decode_utf8 );
sub register_column {
@akzhan
akzhan / HashRefInflator.pm
Created Jul 5, 2016
HashRefInflator that knows about utf8
View HashRefInflator.pm
package BUX::DB::HashRefInflator;
use strict;
use warnings;
use utf8;
use parent qw( DBIx::Class::ResultClass::HashRefInflator );
sub inflate_result {
my ( $self, @args ) = @_;
View dbic_fast_respond_with_json.pm
use JSON::XS ();
use DBIx::Class::ResultClass::HashRefInflator;
my $jsoner = JSON::XS->new->utf8(0)->allow_blessed;
sub country {
my $self = shift;
my $c = schema->resultset('Country')->search(undef, {
result_class => 'DBIx::Class::ResultClass::HashRefInflator',
@akzhan
akzhan / habraproxy.py
Last active Jun 23, 2016 — forked from anonymous/habraproxy.py
just for fun, not tested :)
View habraproxy.py
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после
# каждого слова из шести букв должен стоять значок «™». Примерно так:
#
# http://habrahabr.ru/company/yandex/blog/258673/
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из
# них, а именно — о настройке ciphersiutes.
#
You can’t perform that action at this time.