Skip to content

Instantly share code, notes, and snippets.

Tim Macfarlane refractalize

Block or report user

Report or block refractalize

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am refractalize on github.
  • I am refractalize (https://keybase.io/refractalize) on keybase.
  • I have a public key whose fingerprint is CFC3 8862 C872 801C 67D4 61C7 AC49 495C A39E 824D

To claim this, I am signing this object:

View CommandLineSetup.js
const child_process = require('child_process')
const {promisify} = require('util')
const exec = promisify(child_process.exec)
module.exports = class CommandLineSetup {
setup () {
}
teardown () {
}
View gist:cb6285c0b66466212e4e6ea203e84e9d

Hyperdom

import hyperdom from 'hyperdom'
import h from hyperdom.html
import renderProductGrid from '../productGrid'
import ProductService from '../../services/product'

class Orders {
  constructor(){
@refractalize
refractalize / index.js
Created Jul 21, 2016
requirebin sketch
View index.js
var plastiq = require('plastiq');
var h = plastiq.html;
var model = {value: "1"};
function render() {
return h('div',
model.value == "1"? h('h1', 'you have selected 1'): undefined,
h('label',
'One',
@refractalize
refractalize / install_node-oracledb_on_elcapitan.md
Last active Jan 13, 2017 — forked from kubo/install_node-oracledb_on_elcapitan.md
Install node-oracledb on OS X 10.11 El Capitan
View install_node-oracledb_on_elcapitan.md

Installing Oracle Clients on Mac OS X El Capitan

(This page is a simplification of another guide to installing oracle on Mac OS X, from which this was forked.)

Get InstantClient version numbers

Run these brew commands:

brew install InstantClientTap/instantclient/instantclient-basiclite
View gist:a363beb3a9fa2d9387f3
  1. application state is passed down to subcomponents

    On the surface this seems quite natural, but in practice things get strange quickly. The issue is that components get their data from two places (sometimes three): from this.props and from this.state (and this.context). What often happens is that you want to store some information, such as some form input data or an AJAX call in this.state, but meanwhile, the parent has passed in some new props in this.props that invalidate that state, or at least make it inconsistent. So you have to merge the new this.props with the this.state in componentWillReceiveProps().

    Secondly, and this is related to the first, it's impossible for a parent component to get at the state of a child component. Also, a plausibly good idea - keep things isolated from each other. But again in practice, this forces weird design decitions: the parent passes an object to the child (in props) that is then modified by the child (form input, etc). This isn't a ma

@refractalize
refractalize / index.js
Created Jan 14, 2015
requirebin sketch
View index.js
var plastiq = require('plastiq');
var h = plastiq.html;
function render(model) {
return h('div',
h.animation(model.animation.bind(model)),
h('div', model.counter)
);
}
@refractalize
refractalize / index.js
Created Jan 14, 2015
requirebin sketch
View index.js
var plastiq = require('plastiq');
var h = plastiq.html;
function render(model) {
return h.promise(model.longRunningOperation, {
pending: 'loading...',
fulfilled: function (value) {
return 'the value from the long-running operation is: ' + value;
}
});
@refractalize
refractalize / index.js
Created Jan 14, 2015
requirebin sketch
View index.js
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div',
h('ul',
model.animals.map(function (animal) {
return h('li', animal.render(model));
})
@refractalize
refractalize / index.js
Created Jan 14, 2015
requirebin sketch
View index.js
var plastiq = require('plastiq');
var h = plastiq.html;
var bind = plastiq.bind;
function render(model) {
return h('div.content',
h('h1', 'People'),
h('ol',
model.people.map(function (person) {
return renderPerson(model, person);
You can’t perform that action at this time.