Skip to content

Instantly share code, notes, and snippets.

View refractalize's full-sized avatar

Tim Macfarlane refractalize

View GitHub Profile
@refractalize
refractalize / index.js
Created January 14, 2015 11:34
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
var component = h.component(function () {
return h('div', 'component counter: ', model.counter);
});
return h('div',
@refractalize
refractalize / index.js
Created January 14, 2015 11:30
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
model.show
? h.component(
{
onadd: function (element) {
@refractalize
refractalize / index.js
Created January 14, 2015 11:14
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
h('input',
{
type: 'file',
binding: {
@refractalize
refractalize / index.js
Last active August 29, 2015 14:13
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var blue = { name: 'blue' };
function render(model) {
return h('div',
h('select',
{binding: [model, 'colour']},
h('option.red', {value: 'red'}, 'red'),
@refractalize
refractalize / index.js
Last active August 29, 2015 14:13
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var blue = { name: 'blue' };
function render(model) {
return h('div',
h('input.red', {
type: 'radio',
name: 'colour',
@refractalize
refractalize / index.js
Created January 14, 2015 11:10
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render() {
return h('div',
'width = ' + window.innerWidth + ', height = ' + window.innerHeight,
h.window({ onresize: function () {console.log('resizing');} })
);
}
@refractalize
refractalize / index.js
Created January 14, 2015 11:08
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
h('button', {
onclick: function () {
return function (render) {
setInterval(function () {
@refractalize
refractalize / index.js
Created January 14, 2015 11:06
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
h('ul',
model.people.map(function (person) {
return h('li', person.name);
})
@refractalize
refractalize / index.js
Last active August 29, 2015 14:13
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
function render(model) {
return h('div',
h('label', "what's your name?"), ' ',
h('input', {type: 'text', binding: [model, 'name']}),
h('div', 'hi ', model.name)
);
}
@refractalize
refractalize / index.js
Created December 28, 2014 22:55
requirebin sketch
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
h('label', "what's your name?"), ' ',
h('input', {type: 'text', binding: bind(model, 'name')}),
h('div', 'hi ', model.name)
);