Skip to content

Instantly share code, notes, and snippets.

View nathanclevenger's full-sized avatar
🚀

Nathan Clevenger nathanclevenger

🚀
View GitHub Profile
@nathanclevenger
nathanclevenger / README.md
Created April 8, 2025 12:35 — forked from sam-lippert/README.md
A fully-functional and extensible metamodeled graph data system with state machines, events, and atomic facts as executable functions. Inspired by ORM and lambda calculus.

exec-symbols

A purely functional DSL for modeling facts, entities, constraints, and state machines in JavaScript—using lambda-calculus–inspired Church encodings and composable building blocks.

This library showcases how to represent boolean logic, pairs, lists, entities, relationships, constraints, events, and more all as functional closures. It may be useful for educational purposes, rule engines, or domain-specific language experiments.


Table of Contents

@nathanclevenger
nathanclevenger / github-proxy-client.js
Created February 19, 2023 19:41 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@nathanclevenger
nathanclevenger / TypedDurableObjectStorage.ts
Created September 1, 2022 14:09 — forked from huw/TypedDurableObjectStorage.ts
Typed Durable Object Storage
import type { Jsonify } from "type-fest";
// Define new storage types here and below and the storage below will automatically use them.
// prettier-ignore
type TypedDurableObjectStorageValue<Key extends string> = Jsonify<
| Key extends "simple" ? boolean : never
| Key extends "complex" ? { age: number } | { name: string } : never
| Key extends `template:type:known` ? number : never
| Key extends `template:type:${string}` ? string | number : never
>;
@nathanclevenger
nathanclevenger / cloak.js
Created August 26, 2022 08:27 — forked from stickfigure/cloak.js
Cloudflare worker that proxies encrypted urls
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const encoder = new TextEncoder();
const decoder = new TextDecoder();
const SECRET_KEY_DATA = encoder.encode('YOUR SECRET KEY');
function normalizeBase64(base64urlencoded) {
return base64urlencoded.replace(/-/g, '+').replace(/_/g, '/');