Skip to content

Instantly share code, notes, and snippets.

View kandy's full-sized avatar

Andrii Kasian kandy

View GitHub Profile
sudo -i
# Make sure the prerequisites are installed.
apt-get -y install autoconf automake curl build-essential libxslt1-dev re2c libxml2-dev
# Install PHP 5 dependencies.
apt-get -y build-dep php5
# Download phpbrew
cd /usr/bin
curl -O https://raw.github.com/c9s/phpbrew/master/phpbrew
# Make phpbrew executable.
chmod +x phpbrew
@kandy
kandy / gist:6205183
Created August 11, 2013 14:40
PHP LPeg lexer
-- Copyright 2006-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
-- PHP LPeg lexer.
local l, token, word_match = lexer, lexer.token, lexer.word_match
local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V
local M = {_NAME = 'php'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
@kandy
kandy / index.php
Last active July 29, 2017 02:35
magento2 db profiler
/** @var \Magento\App\Resource $res */
$res = \Magento\App\ObjectManager::getInstance()->get('Magento\App\Resource');
/** @var Zend_Db_Profiler $profiler */
$profiler = $res->getConnection('read')->getProfiler();
echo "<table cellpadding='0' cellspacing='0' border='0'>";
echo '<caption>', $profiler->getTotalElapsedSecs(), 's ', $profiler->getTotalNumQueries() , 'queries', '</caption>';
foreach ($profiler->getQueryProfiles() as $query) {
/** @var Zend_Db_Profiler_Query $query*/
echo '<tr>';
echo '<td>', number_format(1000 * $query->getElapsedSecs(), 2), 'ms', '</td>';
@kandy
kandy / afp.conf
Created January 7, 2014 18:18 — forked from oscarcck/afp.conf
;
; Netatalk 3.x configuration file
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
;
[Global]
; Global server settings
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so
<?php
/**
* @link http://stackoverflow.com/questions/13865149/speeding-up-xml-schema-validations-of-a-batch-of-xml-files-against-the-same-xml
*/
$mapping = [
'http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd' => 'schema/xhtml1-transitional.xsd',
'http://www.w3.org/2001/xml.xsd' => 'schema/xml.xsd',
];
[fredemmott@devbig076 ~/fbcode/hphp/test] ./run slow/autoload/trait.php
Running 1 tests in 1 threads (0 in serial)
All tests passed.
| | |
)_) )_) )_)
)___))___))___)\
)____)____)_____)\
_____|____|____|____\\__
---------\ SHIP IT /---------
{
"blocks":{
"sales_order_grid":110,
"sales_order_view":67,
"html_head":55,
"comment":51,
"catalog_product_grid":38,
"product_view":34,
"onepage":32,
"onepage_payment_methods":30,
<referenceBlock name="sales.order.grid.columnSet">
<block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_name2" after="real_order_id">
<arguments>
<argument name="id" xsi:type="string">billing_name2</argument>
<argument name="header" xsi:type="string" translate="true">Test Column</argument>
<argument name="index" xsi:type="string">billing_name</argument>
</arguments>
</block>
</referenceBlock>
<?xml version="1.0" encoding="UTF-8"?><!--
/**
* Copyright В© 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../Indexer/etc/indexer.xsd">
<indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext"
class="Magento\CatalogSearch\Model\Indexer\Fulltext"
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Indexer/etc/indexer.xsd">
<indexer id="cms_page_grid" view_id="cms_page_grid" primary="cms_page" class="Magento\Indexer\Model\Action\Collection">
<title translate="true">CMS Page Grid</title>