Tampermonkey userscripts for automatically adding credit card offers
import { | |
encodeBase64, | |
decodeBase64, | |
} from "https://deno.land/std/encoding/base64.ts"; | |
import process from "node:process"; | |
import SuperJSON from "npm:[email protected]"; | |
SuperJSON.registerCustom( | |
{ | |
isApplicable: (v: any): v is Function => typeof v === "function", |
import { getCollection } from "astro:content"; | |
import type { APIRoute } from "astro"; | |
export async function getStaticPaths() { | |
const docs = await getCollection("docs"); | |
return docs.map((doc) => ({ | |
params: { slug: doc.slug }, | |
props: doc, | |
})); | |
} |
import { Draft2019 } from "json-schema-library"; | |
console.log(Draft2019); |
We make JSX configuration a per-val setting by requiring a jsxPragma: https://docs.deno.com/runtime/manual/advanced/jsx_dom/jsx
But most code doesn't do that and relies on a project-wide jsx setting. So, to provide better DX for missing JSX pragmas, we use this CodeMirror extension that detects the lack of a pragma and the presence of JSX syntax, by using CodeMirror's existing syntax tree.
There are two options for the Placemark Globe dataset:
This is "Visionscarto’s “World Atlas”, which is very well-described by the linked document. It's based on Natural Earth but includes some changes:
- Western Sahara as the UN point of view
- Crimea as part of Ukraine
- Increased width of Gaza strip to avoid it being removed by simplification
These are the two main commits used to transition part of Placemark to Deck.gl. It may make sense to reverse these: Deck caused some bugs, and while the performance was a little better, there was no way to transition fully.
import { | |
encodeBase64, | |
decodeBase64, | |
} from "https://deno.land/[email protected]/encoding/base64.ts"; | |
import process from "node:process"; | |
import SuperJSON from "npm:[email protected]"; | |
SuperJSON.registerCustom<Function, string>( | |
{ | |
isApplicable: (v: any): v is Function => typeof v === "function", |
export default 42; |
Request a single tile from PMTiles, use the vector-tiles module to read it, the d3-geo tools to turn it into a string. d3-geo is probably unnecessary.
This approach feels limited:
Requires restitching tiles if more than one. Limited attributes. Any tile-based solution is going to make compromises in favor of responsiveness and lightweight data. What this wants is completeness and non-sliced data.