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 / number-pad.astro
Created February 1, 2024 20:48
Number Pad web component as Astro component
<number-pad {...Astro.props}></number-pad>
<script>
import { FASTElement, css, customElement, html } from "@microsoft/fast-element";
import styles from './number-pad.scss?inline';
const template = html<NumberPad>`
<div class="number-pad" @click="${(x, c) => x.handleClick(c.event)}">
<div class="number-pad-row">
<span role="button">1</span>
<span role="button">2</span>
@davismj
davismj / component.astro
Created January 28, 2024 17:51
Parse application/x-www-form-urlencoded
---
import { parseBody } from 'parse-body'
export const partial = true
const params = await parseBody(Astro.request.body)
---
@davismj
davismj / app.css
Created March 31, 2021 19:52
Challenge: Scrollbar Method
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.container {
position: relative;
overflow: hidden;
max-height: 100vh;
max-width: 100vw;
@davismj
davismj / app.css
Last active March 31, 2021 19:52
Challenge: Scrollbar Method
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.container {
position: relative;
overflow: hidden;
max-height: 100vh;
max-width: 100vw;
@davismj
davismj / app.html
Last active March 31, 2021 19:18
Challenge: Scrollbar Method (solved)
<template>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.container {
position: relative;
overflow: hidden;
@davismj
davismj / app.html
Created March 31, 2021 14:16 — forked from jdanyow/app.html
Aurelia Validation Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@davismj
davismj / app.html
Last active July 21, 2020 17:25 — forked from fkleuver/app.html
Modify a template and rerender
<template>
<require from="custom-table"></require>
<custom-table items.bind="data">
<template replace-part="row">
<tr>
<th>${item.v}</th>
<th>${item.a}</th>
<th>${item.k}</th>
</tr>
</template>
@davismj
davismj / app.html
Last active April 29, 2020 22:43
Modify a template and rerender
<template>
<require from="custom-table"></require>
<custom-table items.bind="data">
<template replace-part="row">
<tr>
<th>${item.v}</th>
<th>${item.a}</th>
<th>${item.k}</th>
</tr>
</template>
@davismj
davismj / app.html
Last active March 11, 2020 16:51
dynamic compose vm api
<template>
<!-- static fields -->
<div>vm1</div>
<select value.bind="vm1">
<option>thingA</option>
<option>thingB</option>
</select>
<div>vm2</div>
<select value.bind="vm2">
@davismj
davismj / app.html
Created January 24, 2020 15:31
"Select All" Checkbox
<template>
<compose view-model="test" model.bind="obj"></compose>
</template>