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 January 7, 2020 22:05
DI inheritance
<template>
<div repeat.for="i of 10">
${i} ${obj[i]}
<button click.delegate="obj[i] = true">do</button>
</div>
</template>
@davismj
davismj / app.html
Last active November 27, 2019 19:10
DI inheritance
<template>
<compose model.bind="{ authId: authId, caseId: caseId }" view-model="test"></compose>
<input change.delegate="authId = $event.target.value" value.one-way="authId" />
<input change.delegate="caseId = $event.target.value" value.one-way="caseId" />
</template>
@davismj
davismj / app.html
Last active November 6, 2019 17:30
"Select All" Checkbox
<template>
<p>
<label>
<input type="checkbox" checked.bind="canSort" change.delegate="if(canSort) sorting = 0" />
Enable Sorting
</label>
</p>
<p>
@davismj
davismj / app.html
Created October 30, 2019 18:28
Compose Deactivation
<template>
<router-view></router-view>
</template>
@davismj
davismj / app.html
Last active October 28, 2019 21:47
Checked and If play nice together
<template>
<div>
<input type="checkbox" checked.bind="one" />1
</div>
<div>
<input type="checkbox" checked.bind="two" />2
</div>
<div>
<input type="checkbox" if.bind="one && two" change.delegate="$el.innerText = 'works good'" />change
</div>
@davismj
davismj / app.html
Created October 17, 2019 17:38
"Select All" Checkbox
<template>
<table>
<thead>
<tr>
<th>
<input type="checkbox"
checked.one-way="selected.length === items.length"
indeterminate.one-way="selected.length > 0 && selected.length < items.length"
change.delegate="$event.target.checked ? selected = items.slice() : selected = []" />
</th>
@davismj
davismj / a.html
Created October 17, 2019 17:06
Compose Deactivation
<template>
<p>a</p>
<a href="#b">b</a>
<compose view-model="comp"></compose>
</template>
@davismj
davismj / app.html
Created October 10, 2019 17:22
Compose Deactivation
<template>
<router-view layout-view="layout.html"></router-view>
<a href="#/one">one</a>
<a href="#/two">two</a>
</template>
@davismj
davismj / app.html
Last active September 18, 2019 17:40
DI inheritance
<template>
<div repeat.for="i of 10">
${i} ${obj[i]}
<button click.delegate="obj[i] = true">do</button>
</div>
</template>
@davismj
davismj / app.html
Last active April 18, 2019 18:40
Attribute properties broken
<template>
<require from="attr"></require>
<div simple="${abc}"></div>
<div simple="shape: ${abc}; color: ${abc}"></div>
<input type="text" value.bind="abc" />
</template>