PEER PEER
|| ||
||------- handshake offer -----> ||
|| ||
|| <----- handshake offer ----||
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
#!/bin/bash | |
# bail if no semver is given | |
if [ $# -eq 0 ]; then | |
echo 'USAGE: npp patch|minor|major' | |
exit 1 | |
fi | |
# ensure all deps are present | |
# XXX: depends on "npm i -g dependency-check" being installed |
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
/** | |
* @param {Number} px - Player X | |
* @param {Number} py - Player Y | |
* @param {Number} pvx - Player Velocity-X | |
* @param {Number} pvy - Player Velocity-Y | |
* @param {Number} tx - Turret X | |
* @param {Number} ty - Turret Y | |
* @param {Number} ts - Turret Projectile Speed | |
**/ | |
function getProjVel (px, py, pvx, pvy, tx, ty, ts) { |
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
<body> | |
<p class="output">output will appear here</p> | |
</body> | |
<script> | |
var recognition = new webkitSpeechRecognition(); | |
// use a pre-defined grammar | |
//var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' | |
//var speechRecognitionList = new webkitSpeechGrammarList(); |
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
// example of using 'hypercore-sync-partial-feeds' module | |
var Sync = require('hypercore-sync-partial-feeds') | |
var Corestore = require('corestorage') | |
var cores1 = new Corestore(ram) | |
var cores2 = new Corestore(ram) | |
// TODO: populate cores |
- there are two rough stages of software that come to mind:
- given an experimental/in-dev tool, you'd want a community that cares about the tech & is sufficiently excited about it & tolerant/forgiving enough of bugginess. in this case, frequent breakages and upgrades are reasonable
- if a community wants a tool that "just works", a stable tool is best. a tool that's mature enough that it basically NEVER needs to be updated again after the initial install, and even if upgraded, are just bug fixes that don't break any compatibility in the data or protocol layers
- Mapeo is in category 1, but is often being deployed in category 2 situations, which seems like a recipe for disappointment & frustration. expecting an immature tool to be a mature tool is going to be frustrating
- ideally we'd do our best to maintain backwards compatibility, but it's worth considering how frequent breaking changes are,
- i.e. if we release a data/proto breaking change every 3-5 months, it doesn't make
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
let store = corestore('my-storage-dir' || ram() || webstore()) | |
// Map a discovery key or local-name to a key. | |
store.keyFromDiscoveryKey(discoKey, cb) | |
store.keyFromLocalName('my-feed', cb) | |
// Create a new hypercore, which can include a local name. (creates + loads) | |
let core = store.create('localname', { valueEncoding: 'utf-8' }) | |
core.ready(cb) |
re: https://drewdevault.com/2018/01/10/Learn-your-package-manager.html
- needs human effort to {write,modify} the package per distro, per update
- do the write/update
- someone working on the distro to review the work & merge it
- need to wait until next release for people to use the package/update
- need to maintain a private pkg server (per distro; or just fuck the others)
- does my pkg then depend on distro pkgs or npm ones?
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 stream = require('stream') | |
module.exports = function (id) { | |
// opts.allowHalfDuplex is _very_ important! Otherwise ending the readable | |
// half of the duplex will leave the writable side open! | |
var counter = new stream.Duplex({allowHalfOpen:false}) | |
counter.processed = [] | |
var payloadsLeft = 3 |
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 sha = require('sha.js') | |
var umkv = require('unordered-materialized-kv') | |
var EventEmitter = require('events').EventEmitter | |
module.exports = ContentAddressableStore | |
function ContentAddressableStore (db, opts) { | |
var kv = umkv(db) | |
var events = new EventEmitter() | |
opts = opts || {} |
NewerOlder