Skip to content

Instantly share code, notes, and snippets.

View ArtemSites's full-sized avatar

Artem Kuznecov ArtemSites

View GitHub Profile
@ArtemSites
ArtemSites / httpd-vhosts.conf
Last active August 11, 2019 11:47
Lampp пример создания локального домена (Linux).
/**************************************
1. sudo gedit /opt/lampp/etc/httpd.conf
uncomment line:
**************************************/
Include etc/extra/httpd-vhosts.conf
/***************************************************
2. sudo gedit /opt/lampp/etc/extra/httpd-vhosts.conf
add this code to the end file:
***************************************************/
@font-face {
font-family: 'Proxima Nova';
src: url('../fonts/proximanova-bold-webfont.eot');
src: url('../fonts/proximanova-bold-webfont.eot?#iefix')
format('embedded-opentype'),
url('../fonts/proximanova-bold-webfont.woff2') format('woff2'),
url('../fonts/proximanova-bold-webfont.woff') format('woff'),
url('../fonts/proximanova-bold-webfont.ttf') format('truetype'),
url('../fonts/proximanova-bold-webfont.svg#proxima_novabold')
format('svg');
@ArtemSites
ArtemSites / Очистка кэша ссылки в вконтакте.
Last active May 20, 2019 14:23
Очистка кэша ссылки в вконтакте.
Осуществляется по данному адресу:
https://vk.com/dev/pages.clearCache
В инпут нужно вставить ссылку и нажать выполнить.
После этого кэш ссылки в вконтакте очистится и можно будет получить новый контент например:
<meta property="og:image" content="image.jpg" />
@ArtemSites
ArtemSites / OPEN GRAPH
Last active September 15, 2021 18:16
Опен граф | Open graph
<meta property="og:title" content="Name of copany" />
<meta property="og:site_name" content="Name of copany" />
<meta property="og:locale" content="ru_RU" />
<meta property="og:description" content="Desc of company" />
<meta property="og:type" content="website" />
<meta property="og:url" content="test.com" />
<meta property="og:image" content="/path/to/the/img.jpg" />
<meta property="vk:image" content="/path/to/the/img.jpg" />
@ArtemSites
ArtemSites / index.html
Last active July 1, 2019 14:56
Кнопка показа и скрытия контента Посмотреть - Скрыть
<div class="question__main">
<div class="question__icon"></div>
<div class="question__content">
<div class="question__title">
ВОПРОС:<br>
Можно ли выписать такого человека без его согласия?
</div>
<div class="question__answer">
@ArtemSites
ArtemSites / index.html
Last active March 25, 2022 15:51
Кнопка плавного скроллинга до верхушки html документа | Smooth scrolling button to the top of the html document
<div id="up-arrow"></div>
</footer>
@ArtemSites
ArtemSites / script.js
Created July 2, 2019 06:31
Фиксация верхнего меню при прокручивании вниз.
var windowScroll = null;
var headerMenuNodePosition = headerMenuNode.offset().top;
var headerMenuNode = $('.js-header-menu');
$(window).on('scroll load', function () {
windowScroll = $(window).scrollTop();
if (windowScroll > headerMenuNodePosition) {
headerMenuNode.addClass(fixedClass);
} else {
@ArtemSites
ArtemSites / script.js
Last active July 2, 2019 07:10
Bitrix - редирект по повторному нажатию на кнопку.
$(document).ready(function() {
$('.services__header-item-btn').click(function() {
$(this).addClass('go-to-the-service');
$('.go-to-the-service').click(function() {
var link = $(this).attr('link');
window.location.href = link;
});
});
});
@ArtemSites
ArtemSites / script.js
Last active July 3, 2019 07:42
Lazy Load img video audio iframe
jQuery(function() {
lazyLoad($('body'));
});
function lazyLoad($content) {
$content.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){
$(this).attr('src', $(this).data('src'));
$(this).removeAttr('data-src');
if($(this).is('source')){
@ArtemSites
ArtemSites / index.html
Last active July 9, 2019 06:56
Раскрывающееся меню со стрелкой.
<li class="header__menu-item">
<a class="header__menu-link" href="#">Пункт меню</a>
<ul class="header__menu-sub">
<li class="header__menu-sub-item">Подпункт меню</li>
<li class="header__menu-sub-item">Подпункт меню</li>
<li class="header__menu-sub-item">Подпункт меню</li>
<li class="header__menu-sub-item">Подпункт меню</li>
<li class="header__menu-sub-item">Подпункт меню</li>
<li class="header__menu-sub-item">Подпункт меню</li>
</ul>