Skip to content

Instantly share code, notes, and snippets.

View nathanclevenger's full-sized avatar
🚀

Nathan Clevenger nathanclevenger

🚀
View GitHub Profile
css

LINEAR - LIMITED BETA RELEASE

The issue tracking tool you'll enjoy using

Linear helps streamline software projects, sprints, tasks, and bug tracking. It's built for high-performance teams.

enter your work email Request Early Access

@nathanclevenger
nathanclevenger / og.js
Created October 30, 2022 03:17
OpenGraph Test
import { ImageResponse } from '@vercel/og';
export const config = {
runtime: 'experimental-edge',
};
export default function () {
return new ImageResponse(
(
<div
@nathanclevenger
nathanclevenger / worker.js
Last active November 30, 2022 11:46
Generate APIs.do Markdown
export default {
fetch: async req => {
// Fetch YAML of Categories, transform to JSON
const apis = await fetch('https://yaml.do/raw.githubusercontent.com/drivly/apis.do/main/apis.yaml').then(res => res.json())
let md = `
# APIs.do: Hypermedia-driven APIs & SDK
@nathanclevenger
nathanclevenger / LiteralTypes.ts
Created October 7, 2022 16:46
Typescript Permutations
type Persona = 'Builder' | 'Coder' | 'Founder'
type Action = 'Designs' | 'Develops' | 'Launches' | 'Grows' | 'Scales'
type Vertical = 'Financial' | 'Insurance' | 'Automotive'
type Activity = 'SaaS' | 'API' | 'App'
type Sentence = `${Persona} ${Action} ${Vertical} ${Activity}`
@nathanclevenger
nathanclevenger / worker.js
Created October 7, 2022 11:59
URI experiments
export default {
fetch: req => fetch('http://ctx.do/api#testingTheHash')
}
@nathanclevenger
nathanclevenger / worker.js
Created October 2, 2022 21:07
Analytics Engine
import db from 'https://pkg.do/analytics.engine.do'
const schema = ({domain, dns, ip, geoIp, geoHtml, webServer, hostname, emails, alexa, phone, majestic, discovered}) =>
(req, env) => env.ZONES.writeDataPoint({
indexes: [domain, dns, ip],
blobs: [geoIp, geoHtml, webServer, hostname, emails, phone, discovered],
doubles: [alexa, majestic],
}
})
@nathanclevenger
nathanclevenger / worker.js
Last active October 2, 2022 15:09
testing library
import { test } from 'https://pkg.do/uvu';
import * as assert from 'https://pkg.do/uvu/assert';
test('Math.sqrt()', () => {
assert.is(Math.sqrt(4), 2);
assert.is(Math.sqrt(144), 12);
assert.is(Math.sqrt(2), Math.SQRT2);
});
test('JSON', () => {
@nathanclevenger
nathanclevenger / worker.js
Last active October 2, 2022 18:47
GitHub Gist API
import { Octokit } = from 'https://pkg.do/@octokit/rest'
export default {
fetch: async (req, env) => {
octokit.rest.gists.get({ gist_id: '03e2a28ca5f6e21d0df4c7f639187b0b' })
}
}
@nathanclevenger
nathanclevenger / worker.js
Last active October 17, 2022 13:09
API experiments
import { json } from 'https://pkg.do/itty-router-extras'
export default {
fetch: req => json({hello: 'Ceru'})
}
import { json } from 'https://pkg.do/itty-router-extras'
export default {
fetch: req => json({req})
}