Skip to content

Instantly share code, notes, and snippets.

View dglazkov's full-sized avatar

Dimitri Glazkov dglazkov

View GitHub Profile
@dglazkov
dglazkov / tutorial-1-blank.ts
Created February 5, 2024 05:42
Tutorial code progresion
/**
* @license
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { board } from "@google-labs/breadboard";
export default await board(({ text }) => {
return { text };
@dglazkov
dglazkov / news-summarizer.json
Last active August 5, 2023 04:10
A simple summarizer of news headlines.
{
"edges": [
{
"from": "input-2",
"to": "promptTemplate-1",
"out": "topic",
"in": "topic"
},
{
"from": "secrets-5",
@dglazkov
dglazkov / google-news-headlines.json
Last active August 5, 2023 03:16
A graph that retrieves Google News headlines.
{
"edges": [
{
"from": "jsonata-5",
"to": "output-6",
"out": "result",
"in": "headlines"
},
{
"from": "xmlToJson-4",
{
"edges": [
{
"from": "input-1",
"to": "prompt-template-6",
"out": "text",
"in": "topic"
},
{
"from": "secrets-8",
@dglazkov
dglazkov / CustomElementsF2FWhiteboardScribble.js
Created January 25, 2016 20:08
Custom Elements F2F Whiteboard Scribble
class Me {
constructor() {
e1 = new Me;
super();
e2 = new Me;
}
}
@dglazkov
dglazkov / README.md
Created October 6, 2015 14:44 — forked from linjunpop/README.md
iOS 7 Safari Notes

CSS font values

-apple-system-headline1
-apple-system-headline2
-apple-system-body
-apple-system-subheadline1
-apple-system-subheadline2
-apple-system-footnote
-apple-system-caption1
// dev B:
var aBar = document.createElement('a-bar');
aBar.appendChild(someElement);
var width = someElement.offsetWidth;
@dglazkov
dglazkov / core-header-panel.html
Last active August 29, 2015 14:20
Example of re-distribution
<div id="outerContainer" vertical layout>
<slot id="headerContent" name="core-toolbar"></slot>
<div id="mainPanel" flex vertical layout>
<div id="mainContainer" flex?="{{mode !== 'cover'}}">
<slot id="mainContent" default></slot>
</div>
<!-- instance -->
<date-range-combo-box>
<input type="date" content-slot="start">
<input type="date" content-slot="end">
</date-range-combo-box>
<template element="date-combo-box">
<content slot="date"></content>
</template>
@dglazkov
dglazkov / gist:fee1dcb9690baf73dff0
Last active April 13, 2016 03:15
Multiple-actor Problem

Definition of the Multiple-actor Problem

The Multiple-actor Problem (MAP) occurs in a web application that contains multiple bits of code, each assuming that they are the only actor in the document. The problem manifests when these assumptions conflict with each other.

Some examples:

  • A web app is written in framework A, then later an analytics script B is added. A makes assumptions about lifetime of elements and handling of events. B is not aware of these assumptions and subtly violates them, causing jank (example)
  • A web app is written using framework A. Attempting to introduce a widgets built using framework B results in weird errors, because B is violating A's assumptions about control of document state (examples 1, [2](http://stackoverflow.com/questions/254