Skip to content

Instantly share code, notes, and snippets.

View garth's full-sized avatar

Garth Williams garth

View GitHub Profile
/* CYCLONE_CONSTANTS */
var VlxDevConstants = VlxDevConstants || {};
/* g_cyclone_general_info */
VlxDevConstants.A_CYC_APPL_SW_VERSION = 1;
VlxDevConstants.A_CYC_APPL_SW_VERSION_1 = 2;
VlxDevConstants.A_CYC_APPL_SW_VERSION_2 = 3;
VlxDevConstants.A_CYC_APPL_SW_VERSION_3 = 4;
VlxDevConstants.A_CYC_APPL_SW_VERSION_4 = 5;
VlxDevConstants.A_CYC_APPL_SW_VERSION_5 = 6;
@garth
garth / README.md
Last active April 8, 2022 09:02
Split DOM nodes

Simple DOM splitter

I couln't find a simple function to split DOM nodes by some child, so here is.

Split any node by a child maintaining all nested nodes across the split. The child node is not included in the split.

To see how it works and what it can do, have a look at the tests.

@garth
garth / readme.md
Last active January 18, 2024 21:58
A Yjs provider for socketsupply

You can use it the same as you do with other yjs providers, but you have to pass it a socket which can be created with someting like this:

// set the peer id
const peerId = window.localStorage.getItem('peerId') ?? (await Encryption.createId())
window.localStorage.setItem('peerId', peerId)

// set the signing keys
const keySeed = window.localStorage.getItem('keySeed') ?? createId()
@garth
garth / connect-emmiter.ts
Last active February 29, 2024 01:43
Connect emitter interface for Fireproof
import {
type DownloadMetaFnParams,
type DownloadDataFnParams,
type UploadMetaFnParams,
type UploadDataFnParams,
type ChannelEmitter,
} from './types'
import { Connection } from '@fireproof/connect'
export type ConnectEmitterParams = {