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 September 15, 2017 08:23
Simple Modal in Aurelia
<template>
<style>
.container {
height: 52px;
width: 52px;
margin-bottom: 8px;
}
.box {
display: inline-block;
border: 1px dashed;
@davismj
davismj / app.html
Last active September 15, 2017 08:33
Task Queue to Solve DOM Timing Issues
<template>
<style>
.container {
height: 52px;
width: 52px;
margin-bottom: 8px;
}
.box {
display: inline-block;
border: 1px dashed;
@davismj
davismj / app.html
Created September 20, 2017 13:42
Simple Modal in Aurelia
<template>
<style>
label {
display: block;
cursor: pointer;
}
.taco-image {
position: absolute;
max-height: 100px;
@davismj
davismj / app.html
Last active September 20, 2017 16:51
Cross-component Communication Example
<template>
<require from="breadcrumbsCustomElement"></require>
<breadcrumbs view-model.ref="breadcrumbs"></breadcrumbs>
<router-view></router-view>
</template>
@davismj
davismj / app.html
Last active November 14, 2017 17:35 — forked from bigopon/app.html
Aurelia function computedFrom
<template>
<style>
label {display: block; padding: 4px 0;}
</style>
<hr/>
<label>
First Name: <input value.bind='firstName' />
</label>
<label>
@davismj
davismj / app.html
Created October 28, 2017 10:43
Aurelia function computedFrom
<template>
<div>
${map.get('a')}: should be ${a}
</div>
<br />
<div>
<div repeat.for="val of map.get('b')">${val} should be ${b[$index]}</div>
</div>
<button click.delegate="click()">click</button>
</template>
@davismj
davismj / app.html
Created October 28, 2017 10:43
Aurelia Map Observer Test
<template>
<div>
${map.get('a')}: should be ${a}
</div>
<br />
<div>
<div repeat.for="val of map.get('b')">${val} should be ${b[$index]}</div>
</div>
<button click.delegate="click()">click</button>
</template>
@davismj
davismj / app.html
Created November 6, 2017 13:38
Aurelia Gist
<template>
<pre>${points | toPath}</pre>
<div repeat.for="point of points">
X <input type="number" value.bind="point.x | number" />
y <input type="number" value.bind="point.y | number" />
</div>
</template>
@davismj
davismj / app.html
Last active December 1, 2017 09:41
Test: Refresh Binding Behavior
<template>
<h1>Refresh Binding Behavior</h1>
<p>Based off of work by <a href="http://www.sobell.net/aurelia-dirty-checking-a-function/">Jason Sobell</a> and <a href="https://www.danyow.net/aurelia-binding-behaviors/">Jeremy Danyow</a></a></p>
<require from="refresh-binding-behavior"></require>
<h2>Observe properties of arrays of objects</h2>
<div>
<b>60 fps</b>
<pre>${points | json & refresh: 16}</pre>
</div>
@davismj
davismj / app.html
Created November 8, 2017 10:42
Aurelia list example
<template>
<h2>Observe changes to a list</h2>
<p>We can observe items in a list and bind to their properties using the repeat.for binding</p>
<div repeat.for="item of items">
<h3>
${item.name}
<label>
<input type="checkbox" checked.bind="item.good" />
Good?
</label>