Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Little zone117x

View GitHub Profile
@zone117x
zone117x / readline-transform-stream.ts
Last active Jan 12, 2021
Readline transform stream
View readline-transform-stream.ts
import * as readline from 'readline';
import * as stream from 'stream';
export async function* asyncIterableToGenerator<T>(iter: AsyncIterable<T>) {
for await (const entry of iter) {
yield entry;
}
}
export class LineReaderStream extends stream.Duplex {
View mdn-json-sample.json
{
"squadName": "Super hero squad",
"homeTown": "Metro City",
"formed": 2016,
"secretBase": "Super tower",
"active": true,
"members": [
{
"name": "Molecule Man",
"age": 29,
@zone117x
zone117x / kubesail.gaia-hub-disk.yaml
Last active Sep 1, 2020
KubeSail template for deploying a free-tier Gaia Hub with disk-based storage
View kubesail.gaia-hub-disk.yaml
# Gaia hub & reader container deployment controller
apiVersion: apps/v1
kind: Deployment
metadata:
name: gaia-app
spec:
selector:
matchLabels:
app: gaia-app
@zone117x
zone117x / # osslsigncode - 2019-08-06_10-10-11.txt
Created Aug 6, 2019
osslsigncode on macOS 10.14.5 - Homebrew build logs
View # osslsigncode - 2019-08-06_10-10-11.txt
Homebrew build logs for osslsigncode on macOS 10.14.5
Build date: 2019-08-06 10:10:11
@zone117x
zone117x / clarity-contract-interface-json.json
Last active Jun 21, 2019
clarity-contract-interface-json
View clarity-contract-interface-json.json
{
"functions": [
{
"name": "f00",
"access": "private",
"args": [
{
"name": "a1",
"type": "int128"
}
@zone117x
zone117x / gist:790486a8ea29ccf54621bf2d33a3909a
Created Mar 25, 2019
mattlittle.id blockstack verification
View gist:790486a8ea29ccf54621bf2d33a3909a
Verifying my Blockstack ID is secured with the address 1159ZPz88pypemHP84SMacuJWa3XmFSKcv https://explorer.blockstack.org/address/1159ZPz88pypemHP84SMacuJWa3XmFSKcv
View blockstack.d.ts
/// <reference types="bigi" />
/// <reference types="node" />
/// <reference types="bn.js" />
declare module "errors" {
export const ERROR_CODES: {
MISSING_PARAMETER: string;
REMOTE_SERVICE_ERROR: string;
INVALID_STATE: string;
NO_SESSION_DATA: string;
UNKNOWN: string;
@zone117x
zone117x / crypto-webworker-support-check.js
Created Jan 15, 2019
Check for web worker Crypto API support
View crypto-webworker-support-check.js
// Checks if the global.crypto API is supported inside web workers.
// Uses a serialized function inside a Blob URL to run a web worker
// without an external file.
// See https://medium.com/@roman01la/run-web-worker-with-a-function-rather-than-external-file-303add905a0
function checkCryptoWorkerSupport() {
return new Promise((resolve) => {
const checkFn = () => {
const cryptoSupported = self.crypto && self.crypto.getRandomValues
postMessage(!!cryptoSupported)
View gist:855b735abf5c6b9575d181fde60fdbf0
42pVXU53GnA24zoiBpvcwsGEcnXvjdAG2aScfMW7Kkck9ftGfpb9pwRXUQAas2e8jKHYKvXaZNosGYAqwJYwhbCu7KjkYxo