Skip to content

Instantly share code, notes, and snippets.

View gskachkov's full-sized avatar

Oleksander Skachkov gskachkov

  • Itera Consulting
  • Ukraine, Kiev
View GitHub Profile
class Animation {
constructor(options) {
// Called when a new animator is instantiated
// Used to set stuff up for each use of an animator
}
animate(currentTime, effect) {
// currentTime - The current time from the defined timeline
// effect - Group of effects that this animation is working on
// Animation frame logic goes here.
class CircleColor {
static get inputProperties() { return ['--circle-color']; }
paint(ctx, geom, properties) {
// Change the fill color.
const color = properties.get('--circle-color').toString();
ctx.fillStyle = color;
// Determine the center point and radius.
const x = geom.width / 2;
const y = geom.height / 2;
html {
margin-left: 2cm;
font-family: "Times", serif;
}
h1 {
font-size: 24px;
}
class simpleLayout {
static get inputProperties() { return [ /* ... */ ]; }
static get childrenInputProperties() { return [ /* ... */ ]; }
static get layoutOptions() {
return { /* ... */ };
}
*intrinsicSizes(children, edges, styleMap) {
class AnimationWorklet {
static get inputProperties() {
return [ /* ... */ ];
}
animate(currentTime, effect) {
//
}
}
class MyPainter {
static get inputProperties() {
return [ /* ... */ ];
}
paint(ctx, geometry, properties) {
// ...
}
}
registerPaint('myPainter', MyPainter);
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
// for Dialogflow fulfillment library docs, samples, and to report issues
'use strict';
const http = require('https');
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');

Contribution in 2018:
WebAssembly:

  1. WebAssembly cache memory address / size on instance (Optimization access to memory properties in WebAssembly) https://bugs.webkit.org/show_bug.cgi?id=177305
  2. WebAssembly: sending module to iframe fails (Fix bug) https://bugs.webkit.org/show_bug.cgi?id=179263
  3. WebAssembly: add support for stream APIs - JavaScript API https://bugs.webkit.org/show_bug.cgi?id=183442
  4. WebAssembly: add support for stream APIs - Streaming compilation (Compile WebAssembly in streaming Way) - In progress!!! https://bugs.webkit.org/show_bug.cgi?id=183443
let x = '../out/main.wasm';
let instance = null;
fetch(x).then(response =>
response.arrayBuffer()
).then(bytes =>
WebAssembly.instantiate(bytes, {
env: {
add_js: (a, b) => a + b
#define WASM_EXPORT __attribute__((visibility("default")))
extern long add_js(long int a, long int b);
long int add_wasm(long int a, long int b)
{
return a + b;
}
WASM_EXPORT