Skip to content

Instantly share code, notes, and snippets.

dmitrybitman

Block or report user

Report or block dmitrybitman

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
@dmitrybitman
dmitrybitman / pre-commit
Created Mar 5, 2012
php code sniffer pre-commit
View pre-commit
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/bin/phpcs
PHPCS_CODING_STANDARD="$(git rev-parse --show-toplevel)/doc/CodeStandard.xml"
@dmitrybitman
dmitrybitman / ruleset.xml
Created Mar 5, 2012
php code sniffer + zend
View ruleset.xml
<?xml version="1.0"?>
<ruleset name="Zend">
<description>A coding standard based on an early Zend Framework coding standard. Note that this standard is out of date.</description>
<!-- Include some sniffs from all around the place -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
View gist:1442414
<script type="text/javascript">
var uvOptions = {};
(function() {
var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/5xyK2WAy2dTtybZ6c5gCeQ.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
})();
</script>
View chart.pl
#!/usr/bin/perl -w
use strict;
use List::Util qw(sum min max);
use POSIX;
my %data = ();
my $max = 3000;
my $min = 0;
my $step = 50;
my $stepsCount = ($max - $min) / $step;
View mapper.pl
#!/usr/bin/perl -w
use strict;
my $splitre = qr/\sU:(\S+).*?\sLT:(\d+)/;
my %re = (
'vk' => '^http://([^/]+.)?(vkontakte\.ru|vk\.com)[/$]',
'odkl' => '^http://([^/]+.)?(odnoklassniki\.ru|odkl.ru)[/$]',
'my' => '^http://([^/]+.)?(my.mail.ru|mir.mail.ru)[/$]'
);
my %sites = map { $_ => qr{$re{$_}} } keys(%re);
You can’t perform that action at this time.