This document describes both high level and more in-depth aspects of realtime collaborative editing. If you're busy, here's a TL;DR:
- users expect it
- we need it
- we can do it
- we can sustainably support it
- there are a number of problems to solve of various severity, all of them solvable
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 type JsonSchemaTypePrimitive = 'null' | 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; | |
export type JsonSchemaType = JsonSchemaTypePrimitive | JsonSchemaTypePrimitive[]; | |
export interface JsonSchema { | |
type?: JsonSchemaType; | |
// number | |
minimum?: number; | |
maximum?: number; | |
exclusiveMinimum?: number; | |
exclusiveMaximum?: number; |
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 { Element, Ctx } from '@ubio/engine'; | |
export async function captchaSlider(el: Element, ctx: Ctx) { | |
const page = el.page; | |
// Obtain elements to interact with | |
const sliderEl = (await el.queryOne('.yidun_jigsaw', false))!; | |
const imageEl = (await el.queryOne('.yidun_bg-img', false))!; | |
// Get image resources (base64) so that we can send them for offscreen canvas processing |
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
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public static class HexVectorExtensions { | |
public static Vector2 WorldToPlanar(this Vector3 world) { | |
return new Vector2(world.x, world.z); | |
} |
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
function* generateCombinations(array) { | |
if (array.length == 0) { | |
return; | |
} | |
const head = array[0]; | |
const tail = array.slice(1); | |
yield [head]; | |
for (const comb of generateCombinations(tail)) { | |
yield comb; | |
yield [head].concat(comb); |
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
var ImageResize = module.exports = exports = function(file) { | |
this.originalFile = file; | |
this.backgroundColor = '#fff'; | |
}; | |
ImageResize.prototype.resize = function(width, height, mime, cb) { | |
mime = mime || 'image/jpeg'; | |
var self = this; | |
var reader = new FileReader(); | |
reader.onload = onLoadFile; |