scripts...
This commit is contained in:
1 parent
6deb7e3bcb
commit
866b5f7245
4 files changed
+52
-18
No files matched your search
+5
-9
@@ -8,7 +8,7 @@ handle: NOTimothyLottes
|
||||
post_id: "1687250591813079041"
|
||||
date: 2023-08-03
|
||||
archived: 2026-08-24
|
||||
draft: false
|
||||
draft: true
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
@@ -29,29 +29,25 @@ in_reply_to: ""
|
||||
|
||||
SPC: Left off with KEY and GAMEPAD input GPU-accessable. NOP design, no functions, no API, just a fixed VA address and data format to read, dead easy.
|
||||
|
||||

|
||||
|
||||

|
||||
Media (not lifted): `1687250591813079041_F2pRdu9WgAABCLE_orig.jpg` `1687250591813079041_F2pReKsXoAAPvow_orig.jpg`
|
||||
|
||||
**2/**
|
||||
|
||||
Wrote some console data dumping to aid in bringing up HID parsers for Deck and three generations of PlayStation controllers. Apparently XBox controllers aren't HIDs so not sure how one is supposed to access those.
|
||||
|
||||

|
||||
|
||||

|
||||
Media (not lifted): `1687251721032978432_F2pSfIHXcAMI-IQ_orig.jpg` `1687251721032978432_F2pSfzAWcAMo6t7_orig.jpg`
|
||||
|
||||
**3/**
|
||||
|
||||
Supporting hot plug was a bit of a mess, just trying to open devices every second. Adding open devices to an epoll. {Product, vendor} isn't enough to ID a device, too much aliasing, so I use packet size as well.
|
||||
|
||||

|
||||
Media (not lifted): `1687252813468852225_F2pTfekWYAAAwSi_orig.jpg`
|
||||
|
||||
**4/**
|
||||
|
||||
Open devices with matching packet size get set in a bit array, and I collect up to 4 of those device outputs to sent to the GPU. Special logic to always place Steam Deck controls last to make docking work well.
|
||||
|
||||

|
||||
Media (not lifted): `1687253442643755008_F2pUEG0XwAEwYvP_orig.jpg`
|
||||
|
||||
**5/**
|
||||
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
---
|
||||
title: NOTimothyLottes
|
||||
type: note
|
||||
draft: false
|
||||
description: Archived threads by NOTimothyLottes.
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
---
|
||||
|
||||
- [[archive/threads/NOTimothyLottes/2022-11-04-vulkan-1500-lines-of-overhead-including-header]]
|
||||
- [[archive/threads/NOTimothyLottes/2022-11-05-19-GPU-Programming-Tip-Line-Thread]]
|
||||
|
||||
@@ -278,6 +278,23 @@ def _upsert_wikilink(path: Path, target: str) -> None:
|
||||
"""
|
||||
text = path.read_text(encoding="utf-8")
|
||||
fm, body = _split_frontmatter(text)
|
||||
if not fm.strip():
|
||||
# Frontmatter got nuked by a hand edit. Don't silently emit a
|
||||
# bare wikilink list — fall back to a fresh standard frontmatter
|
||||
# so the file remains a complete page.
|
||||
handle = path.parent.name
|
||||
fm = (
|
||||
f"---\n"
|
||||
f"title: {handle}\n"
|
||||
f"type: note\n"
|
||||
f"draft: false\n"
|
||||
f"description: Archived threads by {handle}.\n"
|
||||
f"tags:\n"
|
||||
f" - archive\n"
|
||||
f" - twitter\n"
|
||||
f" - {handle}\n"
|
||||
f"---\n"
|
||||
)
|
||||
kept: list[str] = []
|
||||
names: list[str] = []
|
||||
handle_dir = path.parent
|
||||
@@ -286,8 +303,6 @@ def _upsert_wikilink(path: Path, target: str) -> None:
|
||||
match = _WIKILINK_ITEM.match(line)
|
||||
if match:
|
||||
name = match.group(1)
|
||||
# Drop stale wikilinks whose folder no longer exists under
|
||||
# this handle. Same-slug duplicates still get collapsed.
|
||||
if name in real_dirs or not real_dirs:
|
||||
if name not in names:
|
||||
names.append(name)
|
||||
@@ -307,10 +322,7 @@ def _upsert_wikilink(path: Path, target: str) -> None:
|
||||
parts.extend(f"- [[{name}]]" for name in names)
|
||||
parts.append("")
|
||||
body_text = "\n".join(parts)
|
||||
if fm:
|
||||
path.write_text(fm.rstrip() + "\n\n" + body_text, encoding="utf-8", newline="\n")
|
||||
else:
|
||||
path.write_text(body_text, encoding="utf-8", newline="\n")
|
||||
path.write_text(fm.rstrip() + "\n\n" + body_text, encoding="utf-8", newline="\n")
|
||||
|
||||
|
||||
def wiki_thread(handle: str, dir_name: str) -> str:
|
||||
|
||||
+20
-3
@@ -259,6 +259,7 @@ def cmd_sync(handle: str | None) -> int:
|
||||
root = VAULT / "archive" / "threads"
|
||||
targets = [root / handle] if handle else None
|
||||
changed = 0
|
||||
skipped = 0
|
||||
for handle_dir in targets or sorted(root.iterdir()):
|
||||
if not handle_dir.is_dir() or handle_dir.name.startswith("."):
|
||||
continue
|
||||
@@ -268,8 +269,24 @@ def cmd_sync(handle: str | None) -> int:
|
||||
text = idx.read_text(encoding="utf-8")
|
||||
end = text.find("\n---", 3)
|
||||
if end < 0:
|
||||
continue
|
||||
fm = text[: end + 4]
|
||||
# Frontmatter isn't closed — fall back to a fresh one rather
|
||||
# than silently skipping.
|
||||
fm = (
|
||||
f"---\n"
|
||||
f"title: {handle_dir.name}\n"
|
||||
f"type: note\n"
|
||||
f"draft: false\n"
|
||||
f"description: Archived threads by {handle_dir.name}.\n"
|
||||
f"tags:\n"
|
||||
f" - archive\n"
|
||||
f" - twitter\n"
|
||||
f" - {handle_dir.name}\n"
|
||||
f"---\n"
|
||||
)
|
||||
skipped += 1
|
||||
print(f"rebuilt frontmatter for {handle_dir.name}")
|
||||
else:
|
||||
fm = text[: end + 4]
|
||||
dirs = sorted(d.name for d in handle_dir.iterdir() if d.is_dir())
|
||||
links = "\n".join(f"- [[archive/threads/{handle_dir.name}/{d}]]" for d in dirs)
|
||||
new = fm + "\n\n" + links + "\n"
|
||||
@@ -279,7 +296,7 @@ def cmd_sync(handle: str | None) -> int:
|
||||
print(f"rewrote {handle_dir.name}: {len(dirs)} dirs")
|
||||
else:
|
||||
print(f"ok {handle_dir.name}: {len(dirs)} dirs")
|
||||
print(f"changed {changed}")
|
||||
print(f"changed {changed}, skipped {skipped}")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user