This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
meta(charset = 'utf-8') | |
meta(name='viewport', content="initial-scale=1.0, width=device-width") | |
link(rel="stylesheet", href="css/main.css") | |
title | |
block title | |
body | |
block main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require("gulp"), | |
browserSync = require('browser-sync'); | |
// Сервер | |
gulp.task('server', function () { | |
browserSync({ | |
port: 9000, | |
server: { | |
baseDir: 'app' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery plugin | |
http://learn.jquery.com/plugins/basic-plugin-creation/ | |
(function ( $ ) { | |
var shade = "#556b2f"; | |
$.fn.greenify = function() { | |
this.css( "color", shade ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Объявление модуля | |
var myModule = (function () { | |
// Инициализирует наш модуль | |
function init () { | |
_setUpListners(); | |
}; | |
// Прослушивает события | |
function _setUpListners () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="wrapper"> | |
<div class="main-content"> | |
</div> | |
</div> | |
<footer class="page-footer"> | |
</footer> | |
/* прибьём футер к низу*/ | |
.wrapper{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clearfix:before, | |
.clearfix:after { | |
content: " "; /* 1 */ | |
display: table; /* 2 */ | |
} | |
.clearfix:after { | |
clear: both; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// key - заменить на ключ, по которому необходимо выполнить сортировку | |
// uasort – сортирует массив, используя пользовательскую функцию mySort | |
function mySort($f1,$f2) | |
{ | |
if($f1->key < $f2->key) return -1; | |
elseif($f1->key > $f2->key) return 1; | |
else return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userB = { | |
sayHello: function() { | |
console.log('Hello '+ this.name); | |
} | |
}; | |
var bob = Object.create(userB, { | |
'id' : { | |
value: MY_GLOBAL.nextId(), | |
enumerable:true // writable:false, configurable(deletable):false by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( selector ).live( events, data, handler ); // jQuery 1.3+ | |
$( document ).delegate( selector, events, data, handler ); // jQuery 1.4.3+ | |
$( document ).on( events, selector, data, handler ); // jQuery 1.7+ |
NewerOlder