Skip to content

Instantly share code, notes, and snippets.

View sebjwallace's full-sized avatar

Sebastian Wallace sebjwallace

  • United Kingdom
View GitHub Profile
@sebjwallace
sebjwallace / navplus.js
Last active July 13, 2025 09:04
drawio navigation plugin
/**
* Navigation Plus Plugin (Standalone)
* Enhances navigation: back/forward history, Command+Click page jump, and key bindings.
* Fully self-contained—no reliance on ElectronApp.js or main app navigation code.
*/
(function() {
function initPlugin() {
if (typeof Draw !== 'undefined' && Draw.loadPlugin) {
Draw.loadPlugin(function(ui) {
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:32
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'XOR',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:29
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'NAND',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:26
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'OR',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:33
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'AND',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:11
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'NOT',
initial: 'off',
states: {
off: {
on: {
HIGH: 'off',
LOW: 'on'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:07
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'transistor',
initial: 'off',
states: {
off: {
on: {
HIGH: 'on',
LOW: 'off'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:03
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'switch',
initial: 'off',
states: {
off: {
on: {
FLIP: 'on'
}
},
on: {
@sebjwallace
sebjwallace / temporal-network.js
Last active May 28, 2018 18:28
Temporal Pooling inspired by cortical layers 4 & 2/3
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
@sebjwallace
sebjwallace / OR_AND_perceptron.js
Created May 13, 2016 17:44
Another simple 'perceptron' implementing a bias to work with both AND / OR
var inputs = [
[0,0],
[1,0],
[0,1],
[1,1]
]
var outputs = [
// AND