View db.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createEvent, Event} from 'effector' | |
type DOMEvent = globalThis.Event | |
type Deferrable<Done, Fail> = { | |
addEventListener(event: 'success', handler: (val: Done) => any): any | |
addEventListener(event: 'error', handler: (err: Fail) => any): any | |
} | |
type ObjectDB = { |
View htmlToForestPlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {parseFragment} from 'parse5' | |
import generate from '@babel/generator' | |
import {parse} from '@babel/parser' | |
import t from '@babel/types' | |
import traverse from '@babel/traverse' | |
import template from '@babel/template' | |
function addFactoryImport(path, defs) { | |
const programPath = path.find(path => path.isProgram()) |
View toposort.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function toposort( | |
rawGraph: Record<string, string[]>, | |
ignore?: Set<string> | |
) { | |
const graph = {} as Record<string, string[]> | |
for (const id in rawGraph) { | |
graph[id] = [...new Set(rawGraph[id])] | |
} | |
const result = [] as string[] | |
const visited = {} as Record<string, boolean> |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const {createStore, createEvent, sample} = require('effector') | |
const clientConnected = createEvent() | |
const statusRequested = createEvent() | |
const updateReceived = createEvent() | |
const clientClosed = createEvent() | |
const pushUpdate = createEvent() | |
const clients$ = createStore([]) | |
.on(clientConnected, (list, client) => [...list, client]) |
View safe-padding.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* size variables */ | |
:root { | |
--md: 8px; | |
--md-2: calc(var(--md) * 2); | |
--md-3: calc(var(--md) * 3); | |
--md-4: calc(var(--md) * 4); | |
} | |
/* safe area defaults */ |
View bar.f12f7610.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parcelRequire.registerBundle('e1095da0325446888ed16378b7e22c16', function() { | |
var e = | |
'undefined' != typeof globalThis | |
? globalThis | |
: 'undefined' != typeof self | |
? self | |
: 'undefined' != typeof window | |
? window | |
: 'undefined' != typeof global | |
? global |
View hear-dom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() | |
const observer = new MutationObserver(function(mutationsList) { |
View decompress.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keyStrUriSafe = | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$' | |
const baseReverseDic = {} | |
const charAt = (str, i) => str.charAt(i) | |
for (let i = 0; i < keyStrUriSafe.length; i++) { | |
baseReverseDic[charAt(keyStrUriSafe, i)] = i | |
} | |
console.log(decompress(localStorage.getItem('code-compressed'))) |
View lsdb.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createEvent, | |
createStore, | |
createEffect, | |
combine, | |
forward, | |
Effect, | |
Store, | |
Event, | |
step |
View h.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createStore, | |
createEvent, | |
is, | |
clearNode, | |
forward, | |
sample, | |
Store, | |
Event, | |
launch |
NewerOlder