Skip to content

Instantly share code, notes, and snippets.

View anpleenko's full-sized avatar
🏠
Working from home

Alexander Anpleenko anpleenko

🏠
Working from home
View GitHub Profile
@anpleenko
anpleenko / _middle.scss
Created March 25, 2015 08:23
CSS3 transform middle
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// CSS3 trasform middle
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@mixin transform-middle(){
position: relative;
top: 50%;
transform: translateY(-50%);
}
@anpleenko
anpleenko / _center.scss
Last active August 29, 2015 14:17
Center SASS mixins
$pixel: px;
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// миксин для центрирования блоков
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@mixin center() {
margin-right : auto;
margin-left : auto;
}
@anpleenko
anpleenko / main.js
Created March 25, 2015 12:38
[js] istouch variable
var istouch = ( !!('ontouchstart' in window)) ? 'touchstart' : 'click';
@anpleenko
anpleenko / main.js
Last active August 29, 2015 14:17
[regexp] input only english text
$("input").on("input", function() {
this.value = this.value.replace(/[а-яА-ЯёЁ]+/i, "");
});
@anpleenko
anpleenko / main.js
Created March 26, 2015 07:47
[js] Javascript Closure Counter
var add = (function () {
var counter = 0;
return function () {return counter += 1;}
})();
add();
add();
add();
// the counter is now 3
@anpleenko
anpleenko / _layout.jade
Last active June 4, 2016 14:41
[JADE] _layout example
doctype html
html(lang="ru")
head
title Jade title
meta(charset="UTF-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1")
//- no scale page
@anpleenko
anpleenko / _center_login_form.scss
Created April 2, 2015 07:16
[SASS] center login form
.login-wrap {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
text-align: center;
&:after {
display: inline-block;
@anpleenko
anpleenko / .gitignore
Last active June 3, 2016 18:24
.gitignore file
# Numerous always-ignore extensions
*.bak
*.diff
*.err
*.exe
*.log
*.orig
*.rej
*.sass-cache
*.swo
@anpleenko
anpleenko / .editorconfig
Last active August 2, 2016 06:29
editorconfig
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@anpleenko
anpleenko / _button.scss
Created August 13, 2015 15:53
button bootstrap style
.button{
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;