This file contains 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
modules.define('block-name', ['i-bem__dom', 'jquery'], function(provide, BEMDOM, $) { | |
provide(BEMDOM.decl(this.name, { | |
onSetMod: { | |
js: { | |
inited: function() { | |
// Пример методов из API i-bem.js | |
// jQuery объект блока, который указывает в отличии от $('.block-name') | |
// на экземпляр текущего блока | |
this.domElem |
This file contains 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
{ | |
block: 'carousel', | |
mods: { theme: 'islands', thumbnail: 'yes' } | |
images: ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg'] | |
} |
This file contains 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="carousel carousel_thumbnail_yes carousel_theme_islands"> | |
<div class="carousel__wrapper"> | |
<div class="carousel__box"> | |
<div class="carousel__item"> | |
<img class="carousel__picture" src="http://static-hosting.org/1.jpg" alt="Картинка 1" /> | |
</div> | |
<div class="carousel__item"> | |
<img class="carousel__picture" src="http://static-hosting.org/2.jpg" alt="Картинка 2" /> | |
</div> | |
<div class="carousel__item"> |
This file contains 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
#!/bin/bash | |
# | |
# description: DevShelf service | |
# processname: node | |
# pidfile: /var/run/devshelf.pid | |
# logfile: /var/log/devshelf.log | |
# | |
# Based on https://gist.github.com/jinze/3748766 | |
# | |
# To use it as service on Ubuntu: |
This file contains 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
block('header')( | |
match(function() { !this.ctx.hideNav; }).content()(function() { | |
return { block: 'search' }; | |
}), | |
match(function() { this.ctx.hideNav; }).content()(function() { | |
return { block: 'nav' }; | |
}) | |
); |
This file contains 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
// В вашем bemjson пишем, внутри блока PAGE, один из его элементов js | |
[ | |
'<!--[if lt IE 9]>', | |
{ elem : 'js', url : '//yandex.st/es5-shims/0.0.1/es5-shims.min.js' }, | |
'<![endif]-->' | |
] | |
// Профит! Теперь можно пользоваться js методами типа map, reduce, some и т.д. |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
/* | |
Triangle with Shadow | |
*/ | |
.triangle | |
{ | |
white-space: nowrap; | |
width: 520px; | |
height: 320px; | |
} |
This file contains 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 name="description" content="[add your bin description]" /> | |
<meta charset=utf-8 /> | |
<title>Events in JavaScript: Removing event listeners</title> | |
</head> | |
<body> | |
<button id="element">Click Me</button> | |
</body> |
This file contains 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
modules.define( | |
'i-bem__dom', | |
['jquery', 'dom', 'events'], | |
function(provide, $, dom, events, BEMDOM) { | |
BEMDOM.decl('post', { | |
onSetMod : { | |
'js' : { | |
'inited' : function() { |