This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Module = (function () { | |
// locally scoped Object | |
var myObject = {}; | |
// declared with `var`, must be "private" | |
var privateMethod = function () {}; | |
myObject.someMethod = function () { | |
// take it away Mr. Public Method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function a(b) { | |
console.log('a'); | |
console.log('b'); | |
b(); | |
} | |
a(function() { | |
console.log('c'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); | |
global $USER; | |
if (!empty($_FILES['review_avatar']['tmp_name'])) { | |
$user = new CUser; | |
$res_user = $user->Update($USER->GetID(), array('PERSONAL_PHOTO' => $_FILES["review_avatar"])); | |
if($res_user) { | |
$res_user = '1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arLoadProductArray = Array( | |
"ACTIVE" => "Y", | |
"IBLOCK_SECTION_ID" => $sectionId, | |
"IBLOCK_ID" => $iblockId, | |
"CODE" => translit($elementName).$sectionId, | |
"PROPERTY_VALUES" => $arProperties, | |
"NAME" => $elementName, | |
"PREVIEW_TEXT" => $elementPreviewText, | |
"DETAIL_TEXT" => $elementDetailText, | |
"DETAIL_PICTURE" => CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"]."/import_xls/КАРТИНКИ/".$elementDetailPicture) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function translit($str) { | |
$rus = array('А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'); | |
$lat = array('A', 'B', 'V', 'G', 'D', 'E', 'E', 'Gh', 'Z', 'I', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'C', 'Ch', 'Sh', 'Sch', 'Y', 'Y', 'Y', 'E', 'Yu', 'Ya', 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'gh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya'); | |
$str = strtolower(str_replace($rus, $lat, $str)); | |
return preg_replace("![^a-z0-9]+!i", "-", $str); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?if(CModule::IncludeModule("sale")) | |
echo Number2Word_Rus(1425.43);?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt"); | |
AddMessage2Log('Моя мессага');?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once($_SERVER['DOCUMENT_ROOT']. "/bitrix/modules/main/include/prolog_before.php"); | |
// добавление заказа в один клик, только по имени и телефону | |
CModule::IncludeModule("sale"); | |
CModule::IncludeModule("catalog"); | |
if(!empty($_REQUEST['name']) && !empty($_REQUEST['phone'])) | |
{ | |
$name = $_REQUEST['name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); | |
CModule::IncludeModule("sale"); | |
if (IntVal($_POST["id"]) > 0) { | |
CSaleBasket::Update($_POST["id"], array("QUANTITY" => $_POST["count"])); | |
} | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php"); |