Skip to content

Instantly share code, notes, and snippets.

View davismj's full-sized avatar
🎓
Computing normal vectors.

Matthew James Davis davismj

🎓
Computing normal vectors.
View GitHub Profile
@davismj
davismj / app.html
Created April 17, 2019 23:52
Compose timing issue
<template>
<require from="big"></require>
if i have a custom element before a compose, and the custom element is big enough, compose should activate twice
<section style="display: flex; max-height: 100px;">
<big count.bind="200" style="flex: 1"></big>
<compose style="flex: 1" view-model="comp" model.bind="{}"></compose>
</section>
</template>
@davismj
davismj / app.html
Last active April 16, 2019 19:24
button component styles (:empty selector)
<template>
<require from="el.html"></require>
<el></el>
<el>hi</el>
</template>
@davismj
davismj / app.html
Last active April 10, 2019 03:32
Compose timing issue
<template>
<require from="big"></require>
if i have a custom element before a compose, and the custom element is big enough, compose should activate twice
<section style="display: flex; max-height: 100px;">
<big count.bind="200" style="flex: 1"></big>
<compose style="flex: 1" view-model="comp" model.bind="{}"></compose>
</section>
</template>
@davismj
davismj / app.html
Last active April 3, 2019 21:16
Table example
<template>
<require from="sce"></require>
<div change.delegate="log($event)">
<sce value.two-way="selected" options.bind="opts" ref="ce"></sce>
<select value.bind="selected" ref="sel">
<option repeat.for="opt of opts">${opt}</option>
</select>
</div>
<pre repeat.for="event of events">${event}</pre>
</template>
@davismj
davismj / app.html
Last active April 1, 2019 22:02
Table example
<template>
<require from="fancy-table.css"></require>
<require from="table-custom-element"></require>
<require from="value-converters"></require>
<require from="sortable-custom-attribute"></require>
<require from="reorderable-custom-attribute"></require>
<require from="resizable-custom-attribute"></require>
<require from="table-custom-element"></require>
<require from="row-custom-element"></require>
<style>
@davismj
davismj / index.html
Last active March 29, 2019 15:47
using router.isLoading
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<style>
section {
// give children a row-style layout
display: flex;
// and fill the page
@davismj
davismj / configService.ts
Last active March 23, 2019 19:56
service example
import { JsonService } from './jsonService';
export class ConfigService extends JsonService {
constructor() {
super('path/to/config.json');
}
}
@davismj
davismj / a.html
Created March 13, 2019 22:58
Compose Deactivation
<template>
<p>a</p>
<a href="#b">b</a>
<compose view-model="comp"></compose>
</template>
@davismj
davismj / app.html
Created March 13, 2019 22:56
Compose Deactivation
<template>
<compose view-model="comp" view-model.ref="compose"></compose>
<button click.delegate="canDeactivate()">can deactivate?</button>
<button click.delegate="deactivate()">deactivate?</button>
<p>Could deactivate: ${couldDeactivate}</p>
<p>Deactivated: ${deactivated}</p>
</template>
@davismj
davismj / app.html
Last active March 13, 2019 22:54
Compose Deactivation
<template>
<compose view-model="comp" view-model.ref="compose"></compose>
<button click.delegate="canDeactivate()">can deactivate?</button>
<button click.delegate="deactivate()">deactivate?</button>
<p>Could deactivate: ${couldDeactivate}</p>
<p>Deactivated: ${deactivated}</p>
</template>