Skip to content

Instantly share code, notes, and snippets.

@kovaldn
kovaldn / jade object
Created May 3, 2015 13:46
jade object
mixin slider(...slides)
article.b-slider
a.b-slider__button-prev(href="#") Пред.
a.b-slider__button-next(href="#") След.
ul.b-slider__list
each slide in slides
li.b-slider__item
img.b-slider__image(src="#{slide.image}")
.b-slider__description
a.b-slider__description-link(href="#{slide.link}") #{slide.linkcapt}
@kovaldn
kovaldn / CSS: all hidden classes
Created April 1, 2013 08:27
CSS: all hidden classes
/*
* Hide from both screenreaders and browsers: h5bp.com/u
*/
.hidden {
display: none !important;
visibility: hidden;
}
/*
@kovaldn
kovaldn / CSS: image replacement
Created April 1, 2013 08:22
CSS: image replacement
/*
* Image replacement
*/
.ir {
background-color: transparent;
border: 0;
overflow: hidden;
/* IE 6/7 fallback */
*text-indent: -9999px;
@kovaldn
kovaldn / CSS: clear floats
Created April 1, 2013 08:34
CSS: clear floats
/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
@kovaldn
kovaldn / CSS: print
Created April 1, 2013 08:36
CSS: print
@media print {
* {
background: transparent !important;
color: #000 !important; /* Black prints faster: h5bp.com/s */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
@kovaldn
kovaldn / JavaScript: array.js
Last active December 17, 2015 01:49
JavaScript: array.js
// Sort numerically and ascending:
var myarray=[25, 8, 7, 41]
myarray.sort(function(a,b){return a - b}) //Array now becomes [7, 8, 25, 41]
@kovaldn
kovaldn / Javascript: datatables.js
Last active December 17, 2015 01:49
Javascript: datatables
/*DATATABLES*/
/*
* 0) Важные настройки
*/
'sScrollX' : '1000px',
'sScrollY' : '1000px',
'sDom' : '<"topbar"Tlf>t<"bottom"pir><"nclear">',
@kovaldn
kovaldn / Javascript: patterns - object literal, module.js
Last active December 17, 2015 10:59
Javascript: patterns - object literal, module
/*
* Architecture - Object Literal
* Advantages:
* - Easer to navigate and discuss
* - Profilers give you actual names to work with
* - You can execute these from firebug console
* - You can write unit tests against them
*/
@kovaldn
kovaldn / IE: firebug lite.js
Last active December 17, 2015 12:39
IE: firebug lite
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
@kovaldn
kovaldn / Javascript: PATTERNS.js
Last active December 17, 2015 12:39
Javascript: PATTERNS
/*
* PATTERNS
*/
// Singleton
var Singleton = new function() {
var single = this;