Skip to content

Instantly share code, notes, and snippets.

View tavriaforever's full-sized avatar

Nickolay Ilchenko tavriaforever

View GitHub Profile
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
#!/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:
block('header')(
match(function() { !this.ctx.hideNav; }).content()(function() {
return { block: 'search' };
}),
match(function() { this.ctx.hideNav; }).content()(function() {
return { block: 'nav' };
})
);
@tavriaforever
tavriaforever / bemtips-es5-shims.js
Last active August 29, 2015 14:01
Если вам нужно поддерживать в проекте IE < 9
// В вашем 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 и т.д.
@tavriaforever
tavriaforever / 0_reuse_code.js
Created May 10, 2014 11:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tavriaforever
tavriaforever / dabblet.css
Created April 6, 2014 07:13
Triangle with Shadow
/*
Triangle with Shadow
*/
.triangle
{
white-space: nowrap;
width: 520px;
height: 320px;
}
<!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>
modules.define(
'i-bem__dom',
['jquery', 'dom', 'events'],
function(provide, $, dom, events, BEMDOM) {
BEMDOM.decl('post', {
onSetMod : {
'js' : {
'inited' : function() {