This file contains 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 Pipe(sequence) { | |
const wrappedIterator = sequence[Symbol.iterator](); | |
this.next = wrappedIterator.next.bind(wrappedIterator); | |
} | |
Pipe.step = function(generator) { | |
return new Pipe({ | |
[Symbol.iterator]: generator | |
}); | |
} |
This file contains 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
$LOAD_PATH << "./lib" | |
require 'mementus' | |
# Prototype of subgraph isomorphism search using Ullmann’s original 1976 | |
# algorithm [1] as the foundation for a depth-first scan that moves forward | |
# through each possible outgoing edge, then attempts to confirm the match by | |
# doing a reverse edge lookup, comparing the query to the target graph. | |
# | |
# This is known to be a NP-complete problem but despite being exponential in | |
# theory, in practice it’s possible to achieve reasonable results by using |
This file contains 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
<html> | |
<head> | |
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/karmilla" type="text/css"/><style> | |
h1, h2, p { | |
font-family: 'Karmilla', sans-serif; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>te ao māori</h1> |
This file contains 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
const rules = { | |
'90%': 0.9, | |
'10%': 0.1 | |
} | |
function pickWeightedValue(rules) { | |
const productions = Object.keys(rules) | |
const weights = Object.values(rules) | |
let maxIndex = 0 |
This file contains 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
require "kramdown" | |
require "mustache" | |
require "fileutils" | |
WEB_DIR = "./public" | |
DOCUMENT_TPL = ".site/templates/document.html" | |
INDEX_TPL = ".site/templates/index.html" | |
HOME_TPL = ".site/templates/homepage.html" | |
Mustache.template_path = ".site/templates/partials" |
OlderNewer