Skip to content

Instantly share code, notes, and snippets.

Avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
View fx.js
/**
* @template T, X, A
* @typedef {import('./protocol').Process<T, X, A>} Process
*/
/**
* @template X, T
* @typedef {import('./protocol').Task<X, T>} Task
*/
View sketch.ts
interface CID {
code: number
version: number
multihash: Uint8Array
bytes: Uint8Array
}
type Future<T> =
| T
| Promise<T>
@Gozala
Gozala / Readme.md
Created Apr 2, 2020
Reproducible test case
View Readme.md

This is illustrating issue with vscode

View async-juniper.rs
use async_std::task;
use juniper::{EmptyMutation, RootNode};
struct Concrete;
enum CustomName {
Concrete(Concrete),
}
#[juniper::graphql_object]
View schema.graphql
type Tag {
id:ID
name: String! @fake(type:word)
}
type InlineLink {
id:ID
to:Resource!
name:String @examples(values: ["automerge", "pushpin", "local-first", "farm"])
description:String @fake(type:words)
@Gozala
Gozala / hypermerge.ts
Created Feb 20, 2020
Attempt to revist hypermerge interface
View hypermerge.ts
type DocID<a> = string
type Doc<a> = a
interface RepoService {
keys: KeyService
create<a>(doc: Doc<a>): Promise<DocID<a>>
read<a>(id: DocID<a>): Promise<a>
change<a>(id: DocID<a>, change: (doc: a) => void): Promise<void>
watch<a>(id: DocID<a>): AsyncIterator<a>
View protocol-patch.diff
diff --git a/toolkit/components/extensions/ExtensionProtocol.jsm b/toolkit/components/extensions/ExtensionProtocol.jsm
new file mode 100644
index 000000000000..723bc3c77f6c
--- /dev/null
+++ b/toolkit/components/extensions/ExtensionProtocol.jsm
@@ -0,0 +1,964 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict"
View postcss.js.flow
// @flow strict
type SourceMapConsumer = {}
type Mapping = {}
type RawSourceMap = {}
type SourceMapGenerator = {}
type AcceptedPlugin = Plugin<any> | Transformer | {
postcss: TransformCallback | Processor;
} | Processor;
@Gozala
Gozala / freeze-dry.js
Created Apr 11, 2019
Lazy freeze-dry
View freeze-dry.js
// @flow strict
import { extractLinksFromDom, extractLinksFromCss } from './extract-links/index.js'
import { documentOuterHTML, pathForDomNode, domNodeAtPath, postcss } from './package.js'
import { Interface } from 'readline';
import { makeLinksAbsolute } from './dry-resources.js';
import makeDomStatic from './make-dom-static/index.js';
import setMementoTags from './set-memento-tags.js'
import setContentSecurityPolicy from './set-content-security-policy/index.js'
View codec.js
interface Format<a> {
format:Format;
defaultHashAlgorithm: string;
encode(a):Promise<Bytes<a>>;
decode(Bytes<a>):Promise<a>;
}
opaque type Bytes<a>:Uint8Array = Uint8Array
type BlockData<a> = Concat<Format, Bytes<a>>
opaque type Concat<a:Uint8Array, b:Uint8Array>:Uint8Array = Uint8Array
You can’t perform that action at this time.