Skip to content

Instantly share code, notes, and snippets.

View veksa's full-sized avatar

Alex Khizhnyi veksa

View GitHub Profile
Ёж
Ёко
Ёлка
Ёрш
Ёсена
Ёшико
Аави
Аалия
Аало
Ааре
@veksa
veksa / bots
Created July 20, 2014 02:56
Список нежелательных ботов
# Block Bad Bots & Scrapers
SetEnvIfNoCase User-Agent "Aboundex" bad_bot
SetEnvIfNoCase User-Agent "80legs" bad_bot
SetEnvIfNoCase User-Agent "360Spider" bad_bot
SetEnvIfNoCase User-Agent "^Java" bad_bot
SetEnvIfNoCase User-Agent "^Cogentbot" bad_bot
SetEnvIfNoCase User-Agent "^Alexibot" bad_bot
SetEnvIfNoCase User-Agent "^asterias" bad_bot
SetEnvIfNoCase User-Agent "^attach" bad_bot
SetEnvIfNoCase User-Agent "^BackDoorBot" bad_bot
@veksa
veksa / price-generate
Created July 19, 2014 17:39
Bitrix, генерирования свойства "минимальная цена"
/*Version 0.3 2011-04-25*/
AddEventHandler("iblock", "OnAfterIBlockElementUpdate", "DoIBlockAfterSave");
AddEventHandler("iblock", "OnAfterIBlockElementAdd", "DoIBlockAfterSave");
AddEventHandler("catalog", "OnPriceAdd", "DoIBlockAfterSave");
AddEventHandler("catalog", "OnPriceUpdate", "DoIBlockAfterSave");
function DoIBlockAfterSave($arg1, $arg2 = false)
{
$ELEMENT_ID = false;
$IBLOCK_ID = false;
$OFFERS_IBLOCK_ID = false;
@veksa
veksa / breadcrumbs
Created July 19, 2014 16:55
Bitrix, стандартный шаблон breadcrubms
<?if( !defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true ) die();
if( empty( $arResult ) )
return "";
$strReturn = '<ul class="breadcrumb">';
for( $index = 0, $itemSize = count($arResult); $index < $itemSize; $index++ ){
$title = htmlspecialcharsex($arResult[$index]["TITLE"]);
if( $arResult[$index]["LINK"] <> "" && $arResult[$index]['LINK'] != GetPagePath() )
@veksa
veksa / title-format
Created July 19, 2014 16:19
Bitrix, Форматирование заголовков.
if( !CSite::inDir( "/index.php" ) ){
if( strlen( $APPLICATION->GetPageProperty('title') ) > 1 ){
$title = $APPLICATION->GetPageProperty('title');
}else{
$title = $APPLICATION->GetTitle();
}
$APPLICATION->SetPageProperty("title", $title.( $arSite['SITE_NAME'] ? ' - ' : '' ).$arSite['SITE_NAME'] );
$APPLICATION->AddChainItem( $title );
@veksa
veksa / veksa.xml
Last active August 29, 2015 14:00
phpstorm codestyle settings
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="veksa">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
/*
* robot.js
*
* You'll need three keys in order to unlock the
* Algorithm: the red key, the green key, and the
* blue key. Unfortunately, all three of them are
* behind human-proof barriers.
*
* The plan is simple: reprogram the maintenance
* robots to grab the key and bring it through
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
/**********************
* fordingTheRiver.js *
**********************
*
* And there's the river. Fortunately, I was prepared for this.
* See the raft on the other side?
*
* Everything is going according to plan.
*/