Things I Learned
Short, dated notes on things I’ve learned. Longer write-ups live in Writing.
New tools
New tools:
- gh-actions-lockfile to generate and verify lockfiles for gh-actions
- Proxyman is more user-friendly http debugging proxy than Charles Proxy on MacOS
Choose Boring Tech
“Choose Boring Tech” by Dan McKinley
- “The failure mode of boring tech are well-understood”
Django rapid architecture
Notes from “Django rapid architecture”
- Recommends organizing the codebase with interfaces at the top layer followed by readers and “actions”, Finally, ‘data’ as the bottom layer to organize Django codebase to allow for a simple code structure that allows for scaling
VectorChord
VectorChord is a faster pgvector alternative.
actions/checkout
actions/checkoutsaves the workflow token (GITHUB_TOKENor a custom one) in the checked-out repo’s.git/configby default. Workflows that upload the repo as an artifact leak it, and Unit 42 found many projects doing this. GitHub calls it intended behaviour. Turn it off, and scan workflows with zizmor, which would have caught the Ultralytics injection.- uses: actions/checkout@v4 with: persist-credentials: falseReact's setState is asynchronous
React’s
setStateis asynchronous: readthis.stateright after calling it and you may get the old value. To act on the new state, pass a callback, or usecomponentDidUpdate(which also fires on prop changes). From React gotchas.this.setState({ name: 'Jon' }, () => { // runs after the state update and re-render });Navigating VS Code terminals from the keyboard
VS Code’s built-in terminals are hard to move between from the keyboard. These
keybindings.jsonentries fix it, adapted from jbranchaud’s TIL:cmd+[/cmd+]: previous / next terminalcmd+1tocmd+5: terminal by positioncmd+n: new terminal;cmd+w: kill itcmd+t: toggle between terminal and editor
{ "key": "cmd+]", "command": "workbench.action.terminal.focusNext", "when": "terminalFocus" }, { "key": "cmd+[", "command": "workbench.action.terminal.focusPrevious", "when": "terminalFocus" }, { "key": "cmd+1", "command": "workbench.action.terminal.focusAtIndex1", "when": "terminalFocus" }, { "key": "cmd+2", "command": "workbench.action.terminal.focusAtIndex2", "when": "terminalFocus" }, { "key": "cmd+3", "command": "workbench.action.terminal.focusAtIndex3", "when": "terminalFocus" }, { "key": "cmd+4", "command": "workbench.action.terminal.focusAtIndex4", "when": "terminalFocus" }, { "key": "cmd+5", "command": "workbench.action.terminal.focusAtIndex5", "when": "terminalFocus" }, { "key": "cmd+n", "command": "workbench.action.terminal.new", "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" }, { "key": "cmd+w", "command": "workbench.action.terminal.kill", "when": "terminalFocus" }, { "key": "cmd+t", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" }, { "key": "cmd+t", "command": "workbench.action.terminal.toggleTerminal" }