Skip to content

Instantly share code, notes, and snippets.

View khripunovpp's full-sized avatar

Pavel khripunovpp

  • Adcombo
  • Porto
View GitHub Profile
@khripunovpp
khripunovpp / jquery form validator for bootstrap 3
Last active February 27, 2017 17:24
jquery form validator for bootstrap 3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
.has-success + input {
border-color: green !important; /* Стили для input при успешной валидации*/
}
Ограничение доступа к панели WordPress с помощью кода для всех кроме администратора
functions.php
add_action( 'init', 'blockusers_init' );
function blockusers_init() {
if ( is_admin() && ! current_user_can( 'administrator' ) &&
! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( home_url() );
exit;
@khripunovpp
khripunovpp / yandex-map-with-list-groups-twise-depth-bootstrap-adaptive
Last active June 15, 2018 22:10
yandex-map-with-list-groups-twise-depth-bootstrap-adaptive
#map
width: 100%
height: 500px
+ ymaps
width: 100%
height: 500px
.list-group-item
.list-group
margin-top: 20px
.submenu
@khripunovpp
khripunovpp / yandex-map-with-list-bootstrap-adaptive
Last active March 11, 2017 19:17
yandex-map-with-list-bootstrap-adaptive
***********************
groups.js
***********************
// Группы объектов
var items = [
{
name: "Монумент &quot;Родина-Мать&quot;",
style: "islands#redIcon",
center: [50.426472, 30.563022]
},
@khripunovpp
khripunovpp / wordpress-theme-options-tmpl
Created March 14, 2017 17:37
wordpress-theme-options-tmpl
<?php
$true_page = 'myparameters.php'; // это часть URL страницы, рекомендую использовать строковое значение, т.к. в данном случае не будет зависимости от того, в какой файл вы всё это вставите
/*
* Функция, добавляющая страницу в пункт меню Настройки
*/
function true_options() {
global $true_page;
add_options_page( 'Параметры', 'Параметры', 'manage_options', $true_page, 'true_option_page');
}
@khripunovpp
khripunovpp / pug
Last active April 6, 2017 20:00
fixed-phone-button-widget
#phone-button-module
.pbm-wrap
.pbm-outside
button.pbm-button
img.pbm-icon(src='/img/pbm-icon.png', alt='phone-icon')
p.pbm-text Заказать звонок
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#4285f4">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#4285f4">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#4285f4">
@khripunovpp
khripunovpp / gist:c2e21383c53184eb8ed3f31c9abad894
Last active April 9, 2017 07:40
css-infinite-animation-keyframes
@-webkit-keyframes infinite {
0%, 100% {
-webkit-transform: translateX(0);
}
50% {
-webkit-transform: translateX(-100%);
}
}
@keyframes infinite {
0%, 100% {
$("table.price tr").on(
"click",
function() {
if ($(this).find('a').attr('href'))
document.location.href = $(this).find('a')
.attr('href');
});
.slider {
display: flex;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scroll-snap-points-x: repeat(300px);
scroll-snap-type: mandatory;
}
.slider > div {
flex-shrink: 0;