Skip to content

Instantly share code, notes, and snippets.

View davidwhitney's full-sized avatar
🍸
You're all wonderful. That's what's happening.

David Whitney davidwhitney

🍸
You're all wonderful. That's what's happening.
View GitHub Profile
@davidwhitney
davidwhitney / index.html
Created October 19, 2023 14:57
The Worlds Smallest UI Binding Library
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
<script type="module">
function someClick() {
alert("hello");
@davidwhitney
davidwhitney / Container.test.ts
Last active May 2, 2023 11:34
TypeScript Really Simple DI
import { Container, Inject } from "./Container";
describe("Container", () => {
it("should be able to get a class", () => {
const container = new Container();
container.register(TestClass);
const result = container.get<TestClass>(TestClass);
@davidwhitney
davidwhitney / gist:a93713d0e80ba8bf5a23f8bf5e0fec79
Created October 5, 2021 09:59
A Structure for Foundations.txt
A Better Foundation
There's been a lot of noise around the foundation, and its goodness or badness - and what I see is a bunch of people trying to work hard with invisible-to-the-outside constraints that don't always work out. There's a tension between commercial considerations (providing assurance to consumers) and community considerations (freedom of project owners over their own work).
But enough negative.
How could we do better?
What would I do?
What's the kindest thing with the most transparent support?
@davidwhitney
davidwhitney / Interview.md
Created August 26, 2021 10:33
Foundation Interview

Who am I?

Hey I'm David Whitney, I'm from London and I'm an alc... ha, wait wrong meeting! I jest I jest.

So thrilled to be having this conversations.

I'm David and I'm an independent software consultant from London in the UK. In previous all very serious and corporate lives, I've held job titles like "Chief Technical Architect", "Lead Principal Engineer" and "Head of Engineering" at a bunch of market leading orgs around the UK - household names like JustGiving, trainline, JustEat, Gfk, etcetera etcetera.

@davidwhitney
davidwhitney / index.test.ts
Created April 20, 2021 13:02
Diamond kata ts
import { DiamondMaker } from ".";
describe("DiamondMaker makes diamond", () => {
let sut: DiamondMaker;
beforeEach(() => {
sut = new DiamondMaker();
});
it("given A, returns only A", () => {
@davidwhitney
davidwhitney / LICENSE.txt
Created September 28, 2020 11:04
FFMPEG Web Assembly Compilation that supports Wav files.
This software uses code of FFmpeg <http://ffmpeg.org> licensed under
the LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>
and its source can be downloaded here <https://ffmpeg.org/download.html>.
==============================================================================
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
Jean-Marc Valin, Timothy B. Terriberry,
CSIRO, Gregory Maxwell, Mark Borgerding,
Erik de Castro Lopo
@davidwhitney
davidwhitney / DrawableCanvasElement.js
Created July 31, 2020 22:19
Want to draw with your mouse or a finger in your browser? Here, use this.
export class DrawableCanvasElement {
constructor(canvasElementId) {
this.canvasElementId = canvasElementId;
this.paintCanvas = document.getElementById(canvasElementId);
this.paintContext = this.paintCanvas.getContext("2d");
this.activeColour = "black";
this.dragging = false;
this.cursorPoint = { x: 0, y: 0 };
using System;
using System.Collections.Generic;
using System.IO;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
namespace RayCastTalkDemo
{
class Program
{
[{
"name": "Yellow 012 C",
"rgb": {
"r": 255,
"g": 215,
"b": 0
}
}, {
"name": "Bright Red C",
"rgb": {
[{
"name": "100C",
"rgb": {
"r": 246,
"g": 235,
"b": 97
}
}, {
"name": "101C",
"rgb": {