Skip to content

Instantly share code, notes, and snippets.

View paulchubatyy's full-sized avatar
🤍
Evaporating

Paul (xobb) Chubatyy paulchubatyy

🤍
Evaporating
View GitHub Profile
" can haz highlights
syntax enable
" make love to my eyes
colorscheme Tomorrow-Night
" always show tabs
set showtabline=2
" enable recursive file search
@paulchubatyy
paulchubatyy / phpcs-git-hook-pre-receive
Created December 20, 2011 15:48 — forked from bor/phpcs-git-hook-pre-receive
PHP CodeSniffer pre-receive hook for git
#!/bin/sh
# PHP CodeSniffer pre-receive hook for git
PHPCS_BIN="/usr/bin/phpcs"
PHPCS_CODING_STANDARD="PEAR"
# use coding standart dir from local repo
PHPCS_DIR_LOCAL=0
TMP_DIR=$(mktemp -d --tmpdir phpcs-pre-receive-hook.XXXXXXXX)
mkdir "$TMP_DIR/source"
<?php
$result = Mage::getModel('customer/customer')->getCollection()
->join(array('pet' => $this->getTable('partners_earn_transactions')), $this->getTable('customer_entity').'.entity_id = `pet`.customer_id') // Этот метод точно есть в Collection классе? Может нужно взять getCollection()->getSelect() перед тем как колать join?
->addExpressionFieldToSelect('transaction_count', 'COUNT({{pet.id}})')
->addAttributeToFilter('country_id', $country_code)
->addFieldToFilter('is_active', 1)
->addAttributeToSort('COUNT({{pet.id}})')
->addAttributeToSort('SUM({{pet.points}})')
->groupByAttribute($this->getTable('customer_entity').'.entity_id')
#!/bin/bash
################################################## Basic
# this is comment
########### variable (quoting a variable preserves whitequotes)
# USERNAME='lzyy'
#