Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am gozala on github.
  • I am gozala (https://keybase.io/gozala) on keybase.
  • I have a public key ASC1p7w_BQybiSNmeAzX3PuBVbPHyvp8j8Kc3wKZF_Xw5Qo

To claim this, I am signing this object:

View example.js
const refs = new WeakMap()
function requestSomeAPI() {
const api = Cu.cloneInto({
doPrivilegedThing() {
refs.get(this).doPrivilegedThing()
}
}, unprivilegedContext)
refs.set(api, new Privileged())
return api
}
View dgram-adapter.js
// @flow
const EventEmitter = require("events")
const Buffer = require("buffer").Buffer
module.exports = UPDSocket => {
/*::
interface SocketOptions {
type: 'udp4' | 'udp6';
reuseAddr?: boolean;
View API.js
this.MyAPI = class extends ExtensionAPI {
getAPI(context) {
const sandbox = Cu.Sandbox(context.cloneScope, {
sameZoneAs: context.cloneScope,
wantComponents: false,
wantXrays: false
})
const init = Cu.evalInSandbox(function() {
class MyThing {
View keybase.md

Keybase proof

I hereby claim:

  • I am gozala on github.
  • I am gozala (https://keybase.io/gozala) on keybase.
  • I have a public key ASA2D6g4sH109vAMDnnv_tVeA6ErHEeUBew4KNjn3rsWJgo

To claim this, I am signing this object:

View protocol.json
{
"namespace": "protocol",
"types": [
{
"$ref": "ProtocolHandler",
"type": "function",
"description": "Protocol handler",
"async": false,
"parameters": [
{
View Marks.js
import type {
Transaction,
MarkType,
Selection,
ResolvedPos,
Mark,
Node
} from "prosemirror-state"
import { Decoration, DecorationSet } from "prosemirror-view"
View Generator.Event.js
// https://github.com/tc39/proposal-async-iteration
var Read = class Read {
constructor() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
}
return(value) {
View interface-ipld-format.js
interface Callback <error, value> {
(error):void;
(null|void, value):void;
}
class CID {
// Not important here
}
interface Format <node> {
View pull-stream.js
// flow-typed signature: 0e6dc2bb1ed499c5b581b091733fb72c
// flow-typed version: <<STUB>>/pull-stream_v3.6.1/flow_v0.61.0
/**
* This is an autogenerated libdef stub for:
*
* 'pull-stream'
*
* Fill this stub out by replacing all the `any` types.
*