Skip to content

Instantly share code, notes, and snippets.

View refractalize's full-sized avatar

Tim Macfarlane refractalize

View GitHub Profile

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:

const child_process = require('child_process')
const {promisify} = require('util')
const exec = promisify(child_process.exec)
module.exports = class CommandLineSetup {
setup () {
}
teardown () {
}
@refractalize
refractalize / gist:cb6285c0b66466212e4e6ea203e84e9d
Last active March 2, 2018 13:54 — forked from dobiedad/gist:8c70d77d1f2412096a6e7a215779bd20
Changing a property React+Redux vs Hyperdom

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 July 21, 2016 11:21
requirebin sketch
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 January 13, 2017 11:30 — forked from kubo/install_node-oracledb_on_elcapitan.md
Install node-oracledb on OS X 10.11 El Capitan

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
@refractalize
refractalize / gist:a363beb3a9fa2d9387f3
Last active August 29, 2015 14:18
why react is flawed
  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 January 14, 2015 13:47
requirebin sketch
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 January 14, 2015 13:41
requirebin sketch
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 January 14, 2015 11:36
requirebin sketch
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 January 14, 2015 11:35
requirebin sketch
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);