Skip to content

Instantly share code, notes, and snippets.

Sergei Morozov morozov

  • SugarCRM
  • San Jose, CA
Block or report user

Report or block morozov

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
morozov /
Last active Oct 10, 2019
Watch and Diff. A shell script for monitoring changes in configuration files
#!/usr/bin/env bash
set -euo pipefail
function __get_missing_keys {
php -- "$@" << 'EOF'
$args = $GLOBALS['argv'];
morozov /
Last active Dec 6, 2018
A shell script for back-porting Doctrine DBAL pull requests from master to older branches
#!/usr/bin/env bash
set -eu
if [ $# -ne 2 ]; then
echo "Usage: `basename $0` <pull> <branch>";
exit 1;
morozov / disallow-equal-operators.diff
Created Nov 24, 2018
Applied SlevomatCodingStandard.ControlStructures.DisallowEqualOperators to ba4c9a2
View disallow-equal-operators.diff
diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php
index 2a1d9a1b9..4a9a9231a 100644
--- a/lib/Doctrine/DBAL/Connection.php
+++ b/lib/Doctrine/DBAL/Connection.php
@@ -1254,7 +1254,7 @@ class Connection implements DriverConnection
$logger = $this->_config->getSQLLogger();
- if ($this->_transactionNestingLevel == 1) {
+ if ($this->_transactionNestingLevel === 1) {
View sort-by-spec.php
class Sorter
private $callback;
public function __construct(array $orderBy)
$functions = [];

Keybase proof

I hereby claim:

  • I am morozov on github.
  • I am morozov ( on keybase.
  • I have a public key whose fingerprint is 7A03 FFFD 3CFF EF05 3F88 037A 374E ADAF 543A E995

To claim this, I am signing this object:

morozov / format-stmt.php
Created Aug 18, 2017
Prepared Statements Debugging Snippets
View format-stmt.php
function format_sugar_query(SugarQuery $query)
return format_builder(
function format_builder(\Doctrine\DBAL\Query\QueryBuilder $builder)
View php-7.2.0alpha1.txt
$ './configure' '--cache-file=/home/morozov/.phpbrew/cache/config.cache' '--prefix=/home/morozov/.phpbrew/php/php-7.2.0' '--with-config-file-path=/home/morozov/.phpbrew/php/php-7.2.0/etc' '--with-config-file-scan-dir=/home/morozov/.phpbrew/php/php-7.2.0/var/db' '--disable-all' '--enable-session' '--enable-short-tags' '--with-zlib=/usr' '--with-libdir=lib/x86_64-linux-gnu' '--enable-opcache' '--enable-fpm' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-iconv' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-soap' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mb
View db2-bool.php
ID smallint DEFAULT 0
$dsn = 'HOSTNAME=localhost;UID=db2inst1;PWD=Passw0rd;DATABASE=test';
morozov / compiler.end_context.php
Created Nov 6, 2015
Kind of automatic escaping in Smarty
View compiler.end_context.php
function smarty_compiler_end_context($_, Smarty_Compiler $compiler)
morozov /
Last active Jul 19, 2019
A prepare-commit-msg hook which automatically composes commit message based on Jira task summary

Automatic commit message generator based on Jira task summary


  1. Make the script executable: chmod +x jira-prepare-commit-msg.php
  2. Copy or symlink it to the repository hooks directory cp jira-prepare-commit-msg.php /path/to/repo/.git/hooks/prepare-commit-msg
  3. Specify the URL of your Jira server, your username and API token. Make sure HTTPS is used when possible, since the username and the token are sent unencrypted by means of Basic HTTP authentication.
You can’t perform that action at this time.