This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Hello(name){ | |
return ["div", null, | |
["b", null, "Hello "], | |
["i", null, name] | |
]; | |
} | |
function prerender(root){ | |
for(var i in root) | |
if(Array.isArray(root[i])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function styles(padding){ | |
return { | |
padding: padding + 'px', | |
backgroundColor: '#ddd' | |
} | |
} | |
function Hello(name, styles){ | |
return ["div", {style:styles}, "Hello " + name] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extend(base, derivative){ | |
for(var i in base) | |
if(!derivative[i]) | |
derivative[i] = base[i] | |
return derivative | |
} | |
var base = { | |
color: '#555', | |
fontSize: '2em' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Media { | |
display: flex; | |
align-items: stretch; | |
} | |
.Media__image { | |
margin-right: 1em; | |
} | |
.Media__body { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputs = [ | |
[0,0], | |
[1,0], | |
[0,1], | |
[1,1] | |
] | |
var outputs = [ | |
0, 0, 0, 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputs = [ | |
[0,0], | |
[1,0], | |
[0,1], | |
[1,1] | |
] | |
var outputs = [ | |
// AND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class layer4 { | |
constructor(){ | |
this.distal = [ | |
// X,A,B,C,D,Y | |
[0,0,0,0,0,0], // X | |
[0,0,0,0,0,0], // A | |
[1,1,0,0,0,0], // B | |
[0,0,1,0,0,0], // C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine({ | |
id: 'switch', | |
initial: 'off', | |
states: { | |
off: { | |
on: { | |
FLIP: 'on' | |
} | |
}, | |
on: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine({ | |
id: 'transistor', | |
initial: 'off', | |
states: { | |
off: { | |
on: { | |
HIGH: 'on', | |
LOW: 'off' | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine({ | |
id: 'NOT', | |
initial: 'off', | |
states: { | |
off: { | |
on: { | |
HIGH: 'off', | |
LOW: 'on' | |
} | |
}, |