Skip to content

Instantly share code, notes, and snippets.

@kumavis
kumavis / engine2.js
Last active December 25, 2016 19:35
// example middleware
engine.use(function *(req, res, next) {
// make changes to request
// eg: check cache hit
yield next;
// read the result
// eg: populate cache
});
// cache middleware
https://hangouts.google.com/hangouts/_/lnkpoxjdlng2dbp5clzvjwyj4ue

Client-Side Services

This is a proposal of a pattern for building interlinking web apps. It would allow sandboxed integration with third-party services running on the same computer.

This would enable:

  • services to manage their own client-side secrets (e.g. private keys)
  • building shared caches
  • sharing p2p network resources

metamask roadmap

features

  • app features: tokens, voting, udapp
  • tx analysis trace and ABI matching (for future/unsigned and past/confirmed)
  • detecting relevant txs for history (received eth, tokens)
  • key mgmt (hardware, cloud, dao proposal generator)
  • multichain support

platform

const client = Raven.config(ravenTarget, {
release,
transport: function(opts) {
// modify report urls
const report = opts.data
rewriteReportUrls(report)
// make request normally
client._makeRequest(opts)
}
})

test details

contentRouting.findProviders

real browser dht network network size 85 kbucket 20 maxPeers 40 randomWalk off visible connection churn due to maxPeers

test details

contentRouting.findProviders

real browser dht network network size 60 kbucket 20 maxPeers 40 randomWalk off visible connection churn due to maxPeers

@kumavis
kumavis / experiment1.js
Last active August 21, 2019 07:51
ses sloppyGlobals mini kernel
const test = require('tape-promise').default(require('tape'))
const SES = require('../lib/ses.umd.js')
const realm = SES.makeSESRootRealm()
test(async t => {
const globalStore = {}
runModuleA()
@kumavis
kumavis / background.js
Last active November 14, 2019 13:45
WebExtension Manifest v3
// // Called when the user clicks on the browser action.
// chrome.action.onClicked.addListener(function(tab) {
// // No tabs or host permissions needed!
// console.log('Turning ' + tab.url + ' red!');
// // chrome.tabs.executeScript({
// // code: 'document.body.style.backgroundColor="red"'
// // });
// });
@kumavis
kumavis / membrane_module.js
Last active November 18, 2019 13:19
simple membrane module system
const { Membrane } = require('es-membrane')
const { defineModule, getRawModule } = createModuleSystem()
//
// define modules
//
// module X
defineModule('x', (require) => {