Skip to content

Instantly share code, notes, and snippets.

View Guria's full-sized avatar

Aleksei Gurianov Guria

View GitHub Profile
@Guria
Guria / cerebral-cli.js
Last active July 13, 2016 13:43
cerebral-view-inquirer :)
import controller from './controller.js'
import {Computed} from 'cerebral'
import {set, copy} from 'cerebral/operators'
import inquirer from 'inquirer'
controller.addSignals({
pageChanged: [ copy('input:page', 'state:page') ],
scaffoldSelected: [
() => console.log('scaffold'),
() => { /* services.scaffold(options) */ },
import { createElement, DOMElement, ReactNode } from 'react';
import { stringify, BEMEntity } from 'rebem-classname';
export interface BEMFactory {
(props: BEMEntity, ...children: ReactNode[]): DOMElement<BEMEntity>
}
function BEM (props: BEMEntity, ...children: ReactNode[]) {
const tag = props.tag || 'div';
@Guria
Guria / index.js
Created January 10, 2016 20:12
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
Controller = require('cerebral')
Model = require('cerebral-model-baobab')
controller = Controller(Model({}))
controller.modules({
a: function(){
return { metsgg: 4 }
},
b: function(m,c) {
@Guria
Guria / kg-menu.bemhtml
Created May 19, 2015 14:37
bemhtml an block `menu`
block('kg-menu')(
content()(function(){
return [
this.ctx.button || { elem: 'button' },
{ elem: 'menu', content: this.ctx.content }
];
}),
elem('menu').def()(function(){
var self = apply('self');
return applyCtx({
/**
* Modules
*
* Copyright (c) 2013 Filatov Dmitry (dfilatov@yandex-team.ru)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* @version 0.1.0
*/
/* /home/c9/workspace/prototypes/_desktop.bundles/index/blocks/roboto/roboto.css: begin */ /**/
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto Regular'), local('Roboto-Regular'), url(//fonts.gstatic.com/s/roboto/v14/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
/* /home/c9/workspace/prototypes/_desktop.bundles/index/blocks/roboto/roboto.css: begin */ /**/
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto Regular'), local('Roboto-Regular'), url(//fonts.gstatic.com/s/roboto/v14/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
({
shouldDeps:[
{
mods: { visible: true}
}
]
})
({
shouldDeps:[
{
mods: { visible: true}
}
]
})