Skip to content

Instantly share code, notes, and snippets.

View igorpronin's full-sized avatar

Igor Pronin igorpronin

View GitHub Profile
@igorpronin
igorpronin / html, js, ajax, php, sql
Last active August 29, 2015 14:27
Ajax example 1, get method
-------client side
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Работа с json</title>
<link rel="stylesheet" href="/jslibs/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/jslibs/bootstrap/dist/css/bootstrap-theme.min.css">
</head>
@igorpronin
igorpronin / js
Created September 13, 2015 09:39
Следить за событиями на странице
// набирать в консоли
// запуск функции
monitorEvents(document.body); // Следить за всеми событиями
monitorEvents(document.body, "mouse"); // Следить за событиями мыши
monitorEvents(document.body, "key"); // Следить за событиями клавиатуры
monitorEvents(document.body, "touch"); // Следить за событиями прикосновений к экрану
monitorEvents(document.body, "control"); // Следить за событиями resize, scroll, select и пр.
@igorpronin
igorpronin / css
Created September 17, 2015 14:38
CSS // Sticky Footer
html, body {
margin: 0;
padding: 0;
}
html {
min-height: 100%;
position: relative;
}
@igorpronin
igorpronin / config.rb
Created October 25, 2015 08:15 — forked from nathansmith/config.rb
Example config.rb file for Compass
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@igorpronin
igorpronin / js
Last active April 10, 2019 05:36
Аяксовая отправка формы + попап на плагине Magnific Popup + блокировка формы во время работы Аякса + функция сброса формы
// Объявление попап-функций. Плагин Magnific Popup
var openSucsessPopup = function() {
$.magnificPopup.open({
items: { src: '#sucsess-popup' },
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
@igorpronin
igorpronin / js
Last active November 23, 2015 12:30
Закрытие попапа по клику вне его
// Без комментов
$(document).mouseup(function(e) {
var div = $("#popup-element");
if (!div.is(e.target) && div.has(e.target).length === 0) {
$('#popup-element').addClass('hidden');
// $('#popup-element').hide(); // еще способ скрыть.
}
});
@igorpronin
igorpronin / gist:cfd54834590d97505c15
Created February 13, 2016 12:27
sass sans-serif trick
// Norm
body
font-family: Helvetica, Arial, Sans-Serif
// Better
body
font-family: Sans-Serif
// Why?
Macs will get awesome Helvetica by default. On PC's,
@igorpronin
igorpronin / sass
Created February 13, 2016 12:49
sass clearfix
.clearfix:before,
.clearfix:after
content: " "
display: table
.clearfix:after
clear: both
.clearfix
*zoom: 1
@igorpronin
igorpronin / js
Created March 2, 2016 17:08
How to change the pop-up position of the jQuery DatePicker control
// more here http://stackoverflow.com/questions/662220/how-to-change-the-pop-up-position-of-the-jquery-datepicker-control
beforeShow: function(input, inst) {
var cal = inst.dpDiv;
var top = $(this).offset().top + $(this).outerHeight();
var left = $(this).offset().left;
setTimeout(function() {
cal.css({
'top' : top,
'left': left
@igorpronin
igorpronin / js
Created March 5, 2016 15:32
gulp copy with all directory structure
gulp.src(['input/folder/**/*']).pipe(gulp.dest('output/folder'));