Replace React Query's server state management with TanStack DB's client-side database.
// api/posts.ts
export const postsApi = {
getAll: async (): Promise<Post[]> => fetch('/api/posts').then(r => r.json()),This gist is a quick explainer on how to install and configure gVisor on K3s. There is a sort of hidden gotcha if you aren't reading the documentation thoroughly. If you already have a K3s cluster setup skip to the appropriate section below.
Install K3s as described in the documentation.
| [Unit] | |
| Wants=network-pre.target | |
| Before=network-pre.target shutdown.target | |
| [Service] | |
| User=root | |
| ExecStart=/bin/sh -ec '\ | |
| [ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\ | |
| echo "\ | |
| add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\ |
| import 'fake-indexeddb/auto'; | |
| import { readFile, writeFile } from 'fs/promises'; | |
| import { exportToJsonString } from 'indexeddb-export-import'; | |
| import { getDatabase } from './Database'; | |
| const inFile = 'bulkInsertableData.json'; | |
| const outFile = 'indexeddb.json'; | |
| const collectionName = 'collection'; | |
| const prepIndexedDB = async () => { |
| #!/bin/bash | |
| # install qemu utils | |
| sudo apt install qemu-utils | |
| # install nbd client | |
| sudo apt install nbd-client |
| import fnmatch | |
| from django.conf import settings | |
| from django.http import HttpResponseForbidden | |
| from whitenoise.middleware import WhiteNoiseMiddleware | |
| class AuthenticatedWhiteNoiseMiddleware(WhiteNoiseMiddleware): | |
| def __init__(self, *args, **kwargs): |
| class KeyifyList(object): | |
| def __init__(self, inner, key): | |
| self.inner = inner | |
| self.key = key | |
| def __len__(self): | |
| return len(self.inner) | |
| def __getitem__(self, k): | |
| return self.key(self.inner[k]) |