Skip to content

Instantly share code, notes, and snippets.

@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@davidfowl
davidfowl / MinimalAPIs.md
Last active October 24, 2024 13:39
Minimal APIs at a glance
@ryanflorence
ryanflorence / question.ts
Created January 12, 2021 21:48
generic generics?
// My DB has multiple collections (tables), they can extend
// this since the only difference is the data an collection,
// they're passed in as generics
export interface Record<TData, TCollection> {
data: TData;
ref: {
collection: {
id: TCollection;
};
id: string;
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active November 4, 2024 07:33
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}