Must run these through a tool that removes newlines like https://www.textfixer.com/tools/remove-line-breaks.php before you plug into Notion.
(
(
not(
empty(
prop("Start Date")
)
)
// May require some slight tweaking, but this should | |
const transformTree = (tree: any): string | (object | string)[] => { | |
if (tree.type === "text") { | |
const cleaned = tree.content | |
.replaceAll(/[\n\r]/g, " ") | |
.replaceAll(/\s{2,}/g, "") | |
.trim(); | |
if ( | |
!/[\dA-Za-z]/g.test(cleaned) || |
import { Editor } from "@endwise/ui/Editor"; | |
import { ErrorView } from "@endwise/ui/query"; | |
import { | |
Box, | |
Button, | |
Group, | |
Input, | |
Select, | |
SimpleGrid, | |
Stack, |
// Generic cache class for compressing and storing data in the database. Use it for any data where you don't need to be able to read it. Things like deterministic API calls are a great candidate. | |
// Also a fun experiment to play around with cache invalidation times, where the cache is only "valid" for so long. | |
import zlib from "zlib"; | |
export const getCache = async (prisma: any, key: string): Promise<string | undefined> => { | |
const entry = await prisma.cacheEntry.findUnique({ | |
where: { | |
key, | |
}, |
Must run these through a tool that removes newlines like https://www.textfixer.com/tools/remove-line-breaks.php before you plug into Notion.
(
(
not(
empty(
prop("Start Date")
)
)
// Generated from the Blizzard API on 1/13/2023 for all US/EU realms | |
export const REALM_TO_SLUG = { | |
"Gurubashi": "gurubashi", | |
"Skywall": "skywall", | |
"Dalaran": "dalaran", | |
"Garona": "garona", | |
"Thunder lord": "thunderlord", | |
"Dunemaul": "dunemaul", | |
"Azjol-Nerub": "azjolnerub", | |
"Firetree": "firetree", |
Useful RegEx to extract information from a text-only TQDM stream. I personally found this useful to extract progress data from a Python child process and use it to update a progress bar in my front-end Electron UI.
The RegEx:
(.*): *(\d+%).*(\d+\/\d+) +\[(\d+:\d+)<(\d+:\d+), +(\d+.\d+.*\/s)\]
Capture Groups: