This file contains 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
# FastAPI. | |
async def stream_json_list(items): | |
for item in items: | |
yield item | |
await asyncio.sleep(4.0) # To demonstrate, visibly, the successful implementation. | |
async def get_media_metadata(tags: Optional[Set[str]] = Query(None, | |
description="Tags to filter on")): |
This file contains 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
import itertools | |
def unzip(in_: Iterable[Tuple[Any, ...]]) -> Iterable[Tuple[Any, ...]]: | |
"""Unzips a N-sized iterable of M-tuples to a M-sized iterable of N-tuples. | |
Example: | |
>>> data = [('a', 'b', 'c'), (1, 2, 3)] # 2x3 | |
>>> unzip(data) == [('a', 1), ('b', 2), ('c', 3)] # 3x2 | |
True |
This file contains 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
diff --git a/quartz/components/scripts/darkmode.inline.ts b/quartz/components/scripts/darkmode.inline.ts | |
index c42a367..06767b5 100644 | |
--- a/quartz/components/scripts/darkmode.inline.ts | |
+++ b/quartz/components/scripts/darkmode.inline.ts | |
@@ -1,5 +1,6 @@ | |
-const userPref = window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark" | |
-const currentTheme = localStorage.getItem("theme") ?? userPref | |
+import { getUserPreferredColorScheme, renderExcalidrawLinks } from "./util" | |
+ | |
+const currentTheme = localStorage.getItem("theme") ?? getUserPreferredColorScheme() |