Skip to content

Instantly share code, notes, and snippets.

View igorpronin's full-sized avatar

Igor Pronin igorpronin

View GitHub Profile
@igorpronin
igorpronin / css, js
Last active August 2, 2016 14:21
jQuery Page Preload
.loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;
@igorpronin
igorpronin / css
Last active August 29, 2015 14:27
Turn OFF Animate.css on Mobile Devices
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
@igorpronin
igorpronin / js
Last active August 29, 2015 14:27
jQuery add / remove / change css class on click
$(".click_element").click(function() {
if ($(".target_element").is(".class_1")) {
$(".target_element").removeClass("class_1");
$(".target_element").addClass("class_2");
} else {
$(".target_element").removeClass("class_2");
$(".target_element").addClass("class_1");
}
});
@igorpronin
igorpronin / html, css
Created August 15, 2015 13:50
HTML, CSS / Правильная верстка: ограничение изображения по размеру блока
HTML
<div class="wrap">
<img src="img/img.jpg">
</div>
CSS
.wrap {
width: 200px;
@igorpronin
igorpronin / html, css
Last active August 29, 2015 14:27
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 1. Древний.
Способ надежный, но для .wrap нельзя задать размеры в %. Плохо подходит для адаптива.
-----------
HTML
<div class="wrap">
<div class="content"> </div>
</div>
CSS
@igorpronin
igorpronin / html, css
Created August 15, 2015 14:39
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 2. Адаптив.
HTML
<div class="wrap">
<div class="content"> </div>
</div>
<div class="wrap">
<img src="http://lorempixel.com/200/200/sports/" width="200" height="200">
</div>
@igorpronin
igorpronin / html, css
Created August 15, 2015 14:53
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 3. Современный, математический.
Работает в новых браузерах. IE - от 10.
---
HTML
<div class="wrap">
<div class="content"> </div>
</div>
<div class="wrap">
@igorpronin
igorpronin / html, css
Created August 15, 2015 16:03
HTML, CSS / Выравнивание нижнего края элемента по центру окна браузера
HTML
<div class="wrap">
<div class="content"> </div>
</div>
CSS
.wrap {
background-color: green;
@igorpronin
igorpronin / js
Created August 16, 2015 17:16
jQuery check and change attribute value on click
$("#click_tag").click(function() {
if ($("#target_tag").attr("attr_name")==("attr_value1")) {
$("#target_tag").attr("attr_name", "attr_value2");
} else {
$("#target_tag").attr("attr_name", "attr_value1");
}
});
@igorpronin
igorpronin / gist:5ece1a8dbc0da6a63705
Last active January 26, 2021 08:51
Git commands, Git usage
Перенес все в мой ман: https://github.com/igorpronin/my-mans/blob/master/git/_git.md
git config --global user.name "User Name" // set user name
git config --global user.email "user@email.com" // set user email
git config --list // show active settings
git help commit // open git manual in browser
cd c:/targetdir // change directory
git init // create git repository in this directory or reinit existing
git status // show info about files status (untracted / unmodified etc)
git add . // add all files to unmodified status