Skip to content

Instantly share code, notes, and snippets.

View jdanyow's full-sized avatar
💭
Confirming my whereabouts

Jeremy Danyow jdanyow

💭
Confirming my whereabouts
View GitHub Profile
@jdanyow
jdanyow / app.html
Created June 16, 2016 13:20
Aurelia Grid Validation Demo
<template>
<validation-summary errors.bind="errors"></validation-summary>
<table class="table table-striped table-compact">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th class="text-right">Age</th>
</tr>
<template>
<require from="./bootstrap-select"></require>
<!-- bootstrap select -->
<bootstrap-select items.bind="planets"
value.bind="selectedPlanet"
options.bind="{}">
<template replace-part="item-template">
${item.name} (${item.diameter})
<template>
<require from="./widget-picker"></require>
<widget-picker widget.bind="shipment.widget" widgets.bind="widgets"></widget-picker>
</template>
@jdanyow
jdanyow / app.html
Last active March 23, 2025 10:09
Aurelia Validation Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@jdanyow
jdanyow / app.html
Last active March 23, 2025 10:09
Aurelia Gist
<template>
<h1>${message}</h1>
</template>
import { set } from 'jsonpointer';
import { maxDate, minDate } from './date';
export function parseForm<T extends object>(
data: FormData | URLSearchParams
): T {
const obj = Object.create(null) as T;
for (const [key, value] of data) {
if (typeof value !== 'string') {
throw new Error(`Unexpected value type: ${value}`);
@jdanyow
jdanyow / drugbank-forms-and-routes.md
Created February 27, 2025 17:43
Lists of possible drugbank medication forms and routes

We have 153 possible forms:

Aerosol
Aerosol, foam
Aerosol, metered
Aerosol, powder
Aerosol, spray
Bar, chewable
Bead
Capsule
@jdanyow
jdanyow / app.html
Last active December 5, 2024 18:04
Aurelia Gist
<template>
<h1>${message}</h1>
</template>
<template>
<require from="./dynamic-expression-binding-behavior"></require>
<require from="./debug"></require>
<label repeat.for="property of properties">
${property.label}
<input value.bind="model & dynamicExpression:property.expression">
</label>
<debug></debug>
const { base64url } = await import('https://cdn.skypack.dev/rfc4648');
/**
* @param {JsonWebKey} key
*/
async function generateThumbprint(key) {
// https://datatracker.ietf.org/doc/html/rfc7638
const { e, kty, n } = key;
const json = JSON.stringify({ e, kty, n });
const encoder = new TextEncoder();
const digest = await crypto.subtle.digest('SHA-256', encoder.encode(json));