This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create schema if not exists omdb; | |
| -- Record types have a 1:1 table to store each record in. | |
| create table if not exists omdb.types ( | |
| id text primary key, | |
| -- Table of all (checkpoint) snapshots of records for this type. | |
| snapshots text unique not null, | |
| -- Fully materialized table of latest records for this type. | |
| latest text unique not null, | |
| created_at timestamptz not null default now() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ordersUrl = "https://www.amazon.com/your-orders/orders" | |
| const wait = (ms = 1_000) => | |
| new Promise(resolve => { | |
| setTimeout(() =>{ | |
| resolve() | |
| }, ms) | |
| }) | |
| const fetchDocument = async url => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const basicLatin = String.fromCharCode(...range(32, 127)) | |
| const makeRandomPassword = ({ | |
| length = 32, | |
| characters = basicLatin | |
| }: { | |
| /** Max 256 */ | |
| length?: number, | |
| characters?: string | ReadonlyArray<string> | |
| } = {}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sourceUrl = "https://m3u8-0.c-spanvideo.org/clip/clip.5081597.576.tsc.m3u8" | |
| const source = await fetch(sourceUrl) | |
| .then(res => res.ok ? res.text() : undefined) | |
| if (!source) | |
| throw new Error("it's over") | |
| const tsBlobs = await Promise.all( | |
| source | |
| .split("\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function * primes(max = 1_000) { | |
| const isComposite = [] | |
| for (let i = 2; i <= max; i++) if (!isComposite[i]) { | |
| yield i | |
| for (let j = i**2; j <= max; j += i) | |
| isComposite[j] = true | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { pipe } = await import("https://unpkg.com/[email protected]/src/util/index.mjs") | |
| const { listen, map, filter, forEach, tap } = await import("https://unpkg.com/[email protected]/src/util/iterable/async.mjs") | |
| const makePuzzle = (n = 4) => { | |
| const solvedPuzzle = | |
| [...Array(n)] | |
| .map((_, rowI) => | |
| [...Array(n)].map((_, colI) => rowI * n + colI + 1) | |
| ) | |
| solvedPuzzle[n - 1][n - 1] = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MIT License | |
| Copyright (c) 2021 Daniel Ethridge | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data:audio/ogg;base64,T2dnUwACAAAAAAAAAADFVwH2AAAAAPid/iQBE09wdXNIZWFkAQE4AYC7AAAAAABPZ2dTAAAAAAAAAAAAAMVXAfYBAAAA+2xiXQE+T3B1c1RhZ3MNAAAATGF2ZjU4LjQ1LjEwMAEAAAAdAAAAZW5jb2Rlcj1MYXZjNTguOTEuMTAwIGxpYm9wdXNPZ2dTAACAuwAAAAAAAMVXAfYCAAAAF6YmxTIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDSTs9TkxBSUBERElGQkRCP0JBQDtBQEEsLPj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//vj//ngL5QtGqtuEn/os6qNWLtN0+6mJ+QtRNy+8k7Z+K3ClKyD+yOXUrsFdj5v//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4grU3ETE+ivMH/IxJJjrIWQAneFkU+65/K35PEGNsMJnSh2RNy8xdRCyaF41RV1fWbrD+S+t9bU7vH3iDABIwT5oh6a8xpe8251fEFv77OI2QsbO0vQtyZc1dd30i5EZr647kYhWq5HRbdixE3Dw0NQreisfyVW14q9ZBY4yC10V4l9XohOlCB5PABWmj0Yu59X9DZsYwEl2RdckXrr9apKtQxOUbS3fnTVqZozZa7+JrG1bgJIQ5B0BR16L6pAPpVTRASyt4sfvolrRCgMCnpIU/QoJ3U2qlPis6eNQr47r4kklWKLGEsMLnDqWu06Jgw18XImW+ODORJX332FiNNqiZdK7OEHiiDwKrh0YJC06XeLPJYYlIztj3WR4Nq+1Nafr6eY8MxPmOvYtU9y0shFOvBR0yn9JgimfAC9uO8bJk9DLZ3/v97XyMu244mLy/apd4tEuPmc4oNAQu1GgHptAr6yP8GM6Vc7hI1/nKb0gTterk0lssjrcHvXuAzsBlQBCBt3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const https = require("https") | |
| const pageHTMLHandler = html => { | |
| const videoURL = html.match(/https:\/\/vidstreaming\.io\/load\.php\?id=.*?SUB/)[0] | |
| require("child_process").exec(`open "${videoURL}"`) | |
| } | |
| const requestHandler = HTMLHandler => response => { | |
| let html = "" | |
| response.on("data", chunk => html += chunk) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const data = [...document.querySelectorAll("#scoreTable > tbody tr")] | |
| .filter(a => a.cells.length > 1) | |
| .map(a => { | |
| const score = a.cells[10].innerText | |
| const [earned, possible] = score.split("/").map(n => parseFloat(n)) | |
| return { | |
| category: a.cells[1].innerText, | |
| earned, possible | |
| } | |
| }) |
NewerOlder