This file contains hidden or 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 leftDaysHoursMinutes = function(){ | |
| var today = new Date(); | |
| var nextEVENT = new Date(2015, 10, 11, 0, 0, 0, 0); // месяц начинается с нуля | |
| var msDelta = nextEVENT.getTime() - today.getTime(); | |
| if (msDelta > 0) { | |
| // дней | |
| var msPerDay = 24 * 60 * 60 * 1000; | |
| var daysLeft = Math.floor(msDelta / msPerDay); | |
| var sDaysLeft = String(daysLeft); | |
| var sDaysText = "дней"; |
This file contains hidden or 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
| <div class="iframe-responsive"> | |
| <img src="/upload/images/640x360.gif" alt=""> | |
| <iframe width="640" height="360" src="https://www.youtube.com/embed/CWaZrgc-g9A?rel=0" frameborder="0" allowfullscreen></iframe> | |
| </div> | |
| .iframe-responsive {position: relative;} | |
| .iframe-responsive img {display: block; width: 100%; height: auto;} | |
| .iframe-responsive iframe {position: absolute; top:0; left: 0; width: 100%; height: 100%; display: block; vertical-align: top;} |
This file contains hidden or 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 (!function_exists('BITGetDeclNum')) { | |
| /** | |
| * Функция возвращает окончание слова, в зависимости от примененного к ней числа | |
| * Например: 5 товаров, 1 товар, 3 товара | |
| * | |
| * @param int $value - число, к которому необходимо применить склонение | |
| * @param array $status - массив возможных окончаний | |
| * @return mixed | |
| */ | |
| function BITGetDeclNum($value = 1, $status = array('','а','ов')) { |
This file contains hidden or 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
| <div data-aspect="1.5"></div> | |
| <script> | |
| $(function($) { | |
| var onResizeWindow = function(){ | |
| $('[data-aspect]').each(function(){ | |
| var aspect = $(this).data('aspect') || 1; | |
| $(this).css('height', $(this).outerWidth() / aspect); | |
| }); |
This file contains hidden or 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
| // ==UserScript== | |
| // @name bitfinex | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://www.bitfinex.com/* | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or 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
| // result_modifier.php | |
| // превью изображений | |
| foreach ($arResult["ITEMS"] as $key => &$arItem) { | |
| if ($arItem["PREVIEW_PICTURE"]) { | |
| $arItem["PREVIEW_PICTURE_THUMB"] = array_change_key_case(CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], array("width" => 500, "height" => 500), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true), CASE_UPPER); | |
| } | |
| if ($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["VALUE"]) { | |
| if (count($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["VALUE"]) == 1) { | |
| $arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"] = array($arItem["DISPLAY_PROPERTIES"]["SLIDER"]["FILE_VALUE"]); |
This file contains hidden or 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
| <? | |
| // echo "<pre>"; | |
| // print_r($_SERVER); | |
| // echo "</pre>"; | |
| // exit; | |
| error_reporting(E_ALL); | |
| $links = array("bitrix", "local", "upload"); |
This file contains hidden or 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
| //init.php | |
| if (!function_exists('custom_mail') && COption::GetOptionString("webprostor.smtp", "USE_MODULE") == "Y") { | |
| function custom_mail($to, $subject, $message, $additional_headers='', $additional_parameters=''){ | |
| if (CModule::IncludeModule("webprostor.smtp")) { | |
| // исправляю переносы строк в заголовках | |
| if (!empty($additional_headers)) { | |
| $additional_headers = str_replace("\r\n", "\n", $additional_headers); // на случай если уже нормальные переносы | |
| $additional_headers = str_replace("\n", "\r\n", $additional_headers); | |
| } |
This file contains hidden or 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; | |
| $USER->Authorize(1); | |
| @unlink(__FILE__); | |
| LocalRedirect("/bitrix/admin/"); | |
| require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php"); | |
| ?> |
This file contains hidden or 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 (!function_exists('human_filesize')) { | |
| function human_filesize($bytes, $decimals = 2) { | |
| $sz = 'BKMGTP'; | |
| $factor = floor((strlen($bytes) - 1) / 3); | |
| return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . " " . @$sz[$factor] . "B"; | |
| } | |
| } |