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
<ifModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript | |
</ifModule> | |
<ifModule mod_headers.c> | |
#кэшировать html и htm файлы на один день | |
<FilesMatch "\.(html|htm)$"> | |
Header set Cache-Control "max-age=43200" | |
</FilesMatch> | |
<FilesMatch "r1.js"> |
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 sanitize_output($buffer) { | |
$search = array( | |
'/\>[^\S ]+/s', // strip whitespaces after tags, except space | |
'/[^\S ]+\</s', // strip whitespaces before tags, except space | |
'/(\s)+/s', // shorten multiple whitespace sequences | |
'/<!--(.|\s)*?-->/' // Remove HTML comments | |
); | |
$replace = array( |
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
{capture name='name'}{hook h='name'}{/capture} | |
{if $smarty.capture.name} | |
{$smarty.capture.name} | |
{/if} |
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 | |
if (!isset($_GET['_route_']) || (isset($_GET['_route_']) && $_GET['_route_'] == 'common/home')){?> | |
<div id="page-preloader"> | |
<div class="spinner"></div> | |
</div> | |
<?php } else {?> | |
<?php }?> |
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
sudo chown -R $USER /usr/local |
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
/* по клику на выпадающий блок на главной странице (на адаптиве) прокручиваем экран в верх | |
что-бы кнопка была в верху экрана, а выпавшая область всегда в зоне видимости | |
*/ | |
$('.panel-title').on('click', function(){ | |
var href = $(this).attr('href'); // узнаем на какой блок кликнули | |
var W = $(window).scrollTop(); // узнаем высоту текущей прокрутки документа | |
var B = $('[href="' + href +'"]').offset().top - $(window).scrollTop(); // возвращает коордитат кнопки относительно высоты экрана | |
var setScroll = W+B-50; // к высоте текущей прокрутки добавили расстояние от верха окна и отняли высоту фиксированного хедера | |
$('html, body').animate({scrollTop: setScroll},500); // устанавливаем прокрутку | |
console.log('координат элемента: ' + href + ' top: ' + top ); |
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 get_cookie ( cookie_name ) | |
{ | |
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); | |
if ( results ) | |
return ( unescape ( results[2] ) ); | |
else | |
return null; |
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 find_my_ip(){ | |
$.ajax({ | |
url: 'https://api.2ip.ua/geo.json', | |
type: 'post', | |
data: '', | |
dataType: 'json', | |
success: function(json) { | |
if(json['region'] == 'Dnipropetrovska oblast'){ | |
$('#dnipro_true').css({'display': 'block','opacity': '1'}); | |
}else{ |
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
$("a.scrollto").click(function() { | |
var elementClick = $(this).attr("href") | |
var destination = $(elementClick).offset().top; | |
jQuery("html:not(:animated),body:not(:animated)").animate({ | |
scrollTop: destination | |
}, 800); | |
return false; | |
}); |
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
// Plugin: jQuery.scrollSpeed | |
// Source: github.com/nathco/jQuery.scrollSpeed | |
// Author: Nathan Rutzky | |
// Update: 1.0.2 | |
(function($) { | |
jQuery.scrollSpeed = function(step, speed, easing) { | |
var $document = $(document), |