Skip to content

Instantly share code, notes, and snippets.

View alexermakov's full-sized avatar

ermakovalexey alexermakov

View GitHub Profile
@alexermakov
alexermakov / right_btn_click.js
Created December 18, 2016 18:06
check right button click
- прослушваем правый клик
$(function(){
$(document).on("contextmenu",function(e){
e.preventDefault();
});
});
@alexermakov
alexermakov / remove dotted except.php
Created November 9, 2016 10:10
удаляем у except [..] в конце
<?
add_filter('excerpt_more', function($more) {
return '...';
});
@alexermakov
alexermakov / htaccess prestashop add.txt
Created November 9, 2016 09:09
доавляем к htacess в prestashop
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
вставляем свои дополнения к файлу htacces prestashop ниже этого комментария
#Your entries go here e.g
php_value max_input_vars 3000
@alexermakov
alexermakov / get page wordpress.php
Last active November 9, 2016 09:07
получить страницу по id wordpress
<?php
$id = 7;// Обязательно передавать переменную
$post = get_post($id);
$content = $post->post_content;
?>
@alexermakov
alexermakov / create hook in prestashop.php
Last active November 9, 2016 09:03
create hook in prestashop
<?
// для модуля регистрируем при установке
public function install() {
if !parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('myCustomHook'))
return false;
return true;
}
@alexermakov
alexermakov / autofill_style.css
Created September 24, 2016 16:21
autofill input style
input {outline: none;}
input:-webkit-autofill {
-webkit-box-shadow: inset 0 0 0 50px #fff !important; /* Цвет фона */
-webkit-text-fill-color: #999 !important; /* цвет текста */
color: #999 !important; /* цвет текста */
}
@alexermakov
alexermakov / favicon_wp_head.php
Created August 9, 2016 10:13
favicon wordpress in head
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?php echo get_template_directory_uri(); ?>/images/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?php echo g
@alexermakov
alexermakov / sub_menu.css
Created August 7, 2016 21:23
фишка с задержкой выпадающего меню
/* делаем задержку показа меню,
а при hover (появлении ее отменяем)
*/
nav li> ul {
transition-delay: 1s;
}
nav li:hover ul {
transition-delay: 0s;
}
@alexermakov
alexermakov / width and height skew element.js
Last active August 6, 2016 14:06
Ширина и высота skew элемента
function getBoundingBox(element){
// Get the transformation matrix as a string
var tm = element.css('transform');
// Transform the string to an array
var regexp = /-?\d+[\.\d]*/g;
tm = tm.match(regexp);
// Get the size of the object and calculate the bounding box
var h = element.height();
@alexermakov
alexermakov / Template-single.php
Last active May 31, 2016 11:12
Template-single
Шаблон для single Wordpress. Нужен плагин WP Custom Post Template
/**
* WP Post Template: blog template
*/