Skip to content

Instantly share code, notes, and snippets.

View aohorodnyk's full-sized avatar
:octocat:
Contributing...

Anton Ohorodnyk aohorodnyk

:octocat:
Contributing...
View GitHub Profile
window.__attemptCheck = 0;
window.__interval = setInterval(function(){
if(window.__attemptCheck > 60){
clearInterval(window.__interval());
}
window.__attemptCheck++;
var content = document.getElementById('google_ads_iframe_/4767388/NUR_Rabota_728x200_0').contentWindow.document.body.innerHTML;
if(content.length > 0){
<div id="content">
<?
$form = $this->beginWidget('ActiveForm', array(
'focus'=>array($model,'email'),
'htmlOptions'=>array(
'class' => 'details contact-form',
),
'clientOptions'=>array(
'validateOnSubmit'=>false,
'validateOnChange'=>true,
{
"name": "fidbig/ssh2",
"type": "library",
"description": "Provides an object-oriented wrapper for the php ssh2 extension.",
"keywords": ["ssh", "ssh2"],
"license": "MIT",
"support": {
"issues": "https://github.com/FidBig/ssh2/issues",
"source": "https://github.com/FidBig/ssh2"
},
drop TABLE test.t1;
create table `test`.`t1` (`id` INT AUTO_INCREMENT PRIMARY KEY, `attribute_id` INT, `store` INT, `value` INT);
INSERT INTO `test`.`t1` VALUES (NULL, 1, 0, 1), (NULL, 1, 2, 2), (NULL, 2, 0, 3), (NULL, 2, 1, 4), (NULL, 3, 0, 4);
SELECT IFNULL(current_store.value, deafult_store.value) AS value, COUNT(*)
FROM test.t1 AS deafult_store
LEFT JOIN test.t1 AS current_store
ON (deafult_store.attribute_id = current_store.attribute_id AND current_store.store = 1)
WHERE deafult_store.store = 0
GROUP BY `value`;
@aohorodnyk
aohorodnyk / BuilderTest.php
Created October 14, 2014 11:07
Это не валидно
$rangeBuilder->expects($this->any())
->method('buildFilter')
->will(
$this->returnCallback(
function (FilterInterface $filter, $isNegation) use (
$conditionManager
) {
/**
* @var \Magento\Framework\Search\Request\Filter\Range $filter
* @var \Magento\Framework\DB\Adapter\AdapterInterface $adapter
<?php
/**
* {license_notice}
*
* @copyright {copyright}
* @license {license_link}
*/
namespace Magento\Framework\Search\Adapter\Mysql\Filter;
SELECT COUNT(*) FROM test.sample; // 3 000 000
SELECT * FROM test.sample LIMIT 3;
/*
1,"Some lond1 text1 with many1 unique1 words"
2,"Some lond2 text2 with many2 unique2 words"
3,"Some lond3 text3 with many3 unique3 words"
*/
INSERT INTO test.fts_doc_id (product_id, data_index) SELECT product_id, data_index FROM test.sample;
@aohorodnyk
aohorodnyk / di_classes.php
Last active August 29, 2015 14:23
executed command: `$ php test.php 100 10000000 > result.txt`
<?php
class A1{}
class A2{}
class A3{}
class A4{}
class A5{}
class A6{}
class A7{}
class A8{}
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogSearch\Model;
use Magento\CatalogSearch\Api\Data\DocumentInterface;
use Magento\Framework\Api\AbstractSimpleObject;