I hereby claim:
- I am huw on github.
- I am huw (https://keybase.io/huw) on keybase.
- I have a public key whose fingerprint is 6A97 CFEE 1CB5 BEB4 D2F2 7B89 D70C 1F1A DB90 C8B7
To claim this, I am signing this object:
| import string | |
| def find_position(char): | |
| for set_num in range(len(table)): | |
| if char in table[set_num]: | |
| return set_num | |
| return False | |
| def forge_offsets(key, direction, offset): | |
| if type(key) is str: |
I hereby claim:
To claim this, I am signing this object:
Since iPadOS 13, Notion should show in desktop mode on iPadOS Safari, which is more fully-featured and pretty much fine for touch/pointer input.
In case you're from Notion and reading this, the things I generally don't like about that interface are:
| import type { Jsonify } from "type-fest"; | |
| // Define new storage types here and below and the storage below will automatically use them. | |
| // prettier-ignore | |
| type TypedDurableObjectStorageValue<Key extends string> = Jsonify< | |
| | Key extends "simple" ? boolean : never | |
| | Key extends "complex" ? { age: number } | { name: string } : never | |
| | Key extends `template:type:known` ? number : never | |
| | Key extends `template:type:${string}` ? string | number : never | |
| >; |
The code above is just a sample—I have adapted it from a production codebase and I can't guarantee it will work as-is. It's just here to illustrate what a solution should look like.
The main things you need to do to get everything hooked up are:
instrumentBuild to accept a passed-through Hub instance, rather than using getCurrentHub() (including, perniciously, in helper functions such as hasTracingEnabled())server/index.ts, create a root transaction from the current route’s name and wrap the loaders and actions in spans via instrumentBuild.root.tsx, pass through your tracing & baggage into the meta function.root.tsx, include the current domain in tracePropagationTargets (because Remix fetchers will fetch from the entire URL rather than / root, which will confuse Sentry)root.tsx, create an ErrorBoundary component (with the v2_errorBoundary flag set if you're| /** | |
| * @file A polyfill for `@cloudflare/ai` that connects to live services in local environments via the Cloudflare API instead of direct bindings. | |
| * | |
| * This only implements embeddings for now, but could be expanded to other models just by extending the types (and adding streaming support). | |
| */ | |
| type ModelName = "@cf/baai/bge-small-en-v1.5" | "@cf/baai/bge-base-en-v1.5" | "@cf/baai/bge-large-en-v1.5"; | |
| interface AiTextEmbeddingsInput { | |
| text: string | string[]; |
| name | description |
|---|---|
grug-brain |
Use when designing features, writing code, reviewing implementations, considering refactoring, evaluating libraries, or applying DRY/SOLID principles - helps resist over-abstraction, premature generalization, unnecessary frameworks, and complexity through systematic questioning about actual needs vs theoretical benefits |
Core principle: Complexity is the enemy. Simple, obvious code beats clever abstractions. Question everything that adds indirection.