Skip to content

Instantly share code, notes, and snippets.

function getFieldById(id: string) {
const field = document.getElementById(id);
if (!field) {
throw new Error(`Can't find field for id "${id}"`);
}
}
function getFieldByName(name: string) {
const fields = document.getElementsByName(name);
if (fields.length !== 0) {
throw new Error(`Found ${fields.length} fields for name "${name}". Expected 1.`);
import { debounce } from 'remirror';
import type { CommandFunctionProps, Transaction } from 'remirror';
/**
* When we debounce positioner re-rendering, we need to trigger an
* update at the end of a burst of activity to actually update the
* view. We use this meta key to bail out of debounce logic, and
* force the positioners to re-render.
* @see isForcedDebouncedUpdate
*/
const DEBOUNCED_POSITIONER_UPDATE = 'debouncedPositionerUpdate';
const AVERAGE_WORD_LENGTH = 5;
const debouncedSelectionUpdate = createDebouncedUpdate(250);
const debouncedDocUpdate = createDebouncedUpdate(500);
export const debouncedPositioner = Positioner.fromPositioner(
selectionPositioner,
{
// Redrawing positioners is expensive, and can lead to jank.
// Crucially, typing can feel very laggy.
// To prevent this, we only re-render the popup when the user
// finished their keyboard/mouse input.
@ronnyroeller
ronnyroeller / signaling-servier-cloudformation.yml
Created August 6, 2021 12:48
Cloudformation config to set up Lambda signaling service for webrtc
YWebRtcTopicsTable:
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: name
KeyType: HASH
AttributeDefinitions:
- AttributeName: name
AttributeType: S
ProvisionedThroughput:
@ronnyroeller
ronnyroeller / signaling-server.ts
Last active April 1, 2024 14:13
Lambda function to provide webrtc signaling server
import { ApiGatewayManagementApi, DynamoDB } from 'aws-sdk';
import { scanItems } from './dynamodb';
const { AWS_REGION, TOPICS_TABLE } = process.env;
const dynamoDb = new DynamoDB({
apiVersion: '2012-08-10',
region: AWS_REGION,
});
Issue Bounty Status
Any issue (limited to first 10 claimed issues) $50 Open
React tables can't be removed with backspace (#952) + $100 Open
React tables created on large screen can't be rendered on small screens (responsive) (#942) + $100 Open
Allow rich interactive content in placeholder (#872) + $100 Open
Support auto-numbered table columns (#845) + $100 Open
getAnnotations() doesn't return identical response for equal result (#876) + $100 Open
Support multiple yjs providers (#1251) + $100 Open
Copying a React table adds an additional column + row (#995) + $100 Open
### Add configurable emoji to callouts (#871) + $100 Claimed