Skip to content

Instantly share code, notes, and snippets.

View colingourlay's full-sized avatar

Colin Gourlay colingourlay

View GitHub Profile
@colingourlay
colingourlay / index.js
Last active October 25, 2016 12:35
requirebin sketch
require('pointer-css-variables')();
// Look at <head> tab to see CSS using variables
// to display coordinates at the cursor
@colingourlay
colingourlay / index.js
Created October 7, 2016 03:53 — forked from yoshuawuyts/index.js
requirebin sketch
const chooet = require('chooet');
const html = require('chooet/html');
chooet(choo => {
app = choo();
app.model({
state: { title: 'Not quite set yet' },
reducers: {
update: (data, state) => ({ title: data })
@colingourlay
colingourlay / index.js
Created October 6, 2016 16:02
requirebin sketch
const chooet = require('chooet');
const html = require('chooet/html');
chooet(choo => {
app = choo();
app.model({
state: { title: 'Not quite set yet' },
reducers: {
update: (data, state) => ({ title: data })

Keybase proof

I hereby claim:

  • I am colingourlay on github.
  • I am colingourlay (https://keybase.io/colingourlay) on keybase.
  • I have a public key whose fingerprint is B491 C16D 2665 A596 4678 1F39 A05D E064 F67F 672F

To claim this, I am signing this object:

@colingourlay
colingourlay / .block
Last active September 18, 2016 22:55 — forked from mbostock/.block
World Map
We couldn’t find that file to show.
@colingourlay
colingourlay / index.js
Created June 28, 2016 21:02
Reduce list of 11 multiple (4) choice question answers to 4 character code, and re-inflate it again.
const CHARSET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz$_';
const MASK = parseInt('111100', 2);
let guesses = [...Array(11)].map((item, index) => {
return Math.floor(Math.random() * 4);
// return index % 4;
});
console.log(guesses);
@colingourlay
colingourlay / esnextbin.md
Last active March 3, 2016 22:36
esnextbin sketch
@colingourlay
colingourlay / web-worker-vdom-challenges.md
Created January 23, 2016 09:17 — forked from lawnsea/web-worker-vdom-challenges.md
A discussion of the challenges I anticipate we will face creating a widely useful system based on a virtual DOM running in a web worker

I have been watching the current discussions about running a virtual DOM in a web worker with a great deal of interest. In 2011, I built a research project, [Treehouse][] ([USENIX Talk][] ([DOMTRIS][] demo at 20:25), [paper][]), which ran a hacked-up version of jsdom in a worker. My goal was fine-grained containment of untrusted scripts, while still providing access to browser APIs that existing code expected.

Treehouse achieved a small amount of influence in academic circles, but it had problems and was ultimately unsuccessful. Virtual DOMs were not a widespread or well-understood idea at the time, so the advantages of running one in a worker

@colingourlay
colingourlay / index.js
Last active January 17, 2016 05:01
Using crel + hyperstyles (browser only)
var hyperstyles = require('hyperstyles');
var styles = { /* Mock CSS Module */
'root': 'Car__root___fg434',
'front-door': 'Car__front-door___b85f9',
'back-door': 'Car__back-door___p9h7j'
};
var crel = hyperstyles(require('crel'), styles);
function render() {
return crel('div.root',
@colingourlay
colingourlay / index.js
Created January 17, 2016 03:38
Using virtual-hypercript + hyperstyles + hyperx
var vdom = require('virtual-dom');
var hyperx = require('hyperx');
var hyperstyles = require('hyperstyles');
var styles = { /* Mock CSS Module */
'root': 'Car__root___fg434',
'front-door': 'Car__front-door___b85f9',
'back-door': 'Car__back-door___p9h7j'
};
var hx = hyperx(hyperstyles(vdom.h, styles));