Sign in

Cole Lawrence

@colelawrence.com
544 followers 568 following 123 posts

End user programming & AI tool designer. 🛠️ CTO at phosphor.co & @forethink.ai 🦀 Rust NYC / RustEastCoast.com organizer 🙋🏻‍♂️he/him

PostsRepliesMedia
Cole Lawrence @colelawrence.com · 24/02/2025
I started working on an open-source todo "UI" that syncs with a markdown file, since all my TODOs are in markdown for AI editing context. Also has a - Pomodoro timer - Customizable sound cues for break start, end, task completion, etc github.com/colelawrence...
Shows how the same TODO markdown file is synchronized in the "floating tracker view", "planner view", and the editor
000
Cole Lawrence @colelawrence.com · 04/02/2025
Made a fun little helper for React to make it possible to "click" buttons without clicking when you have a input focused. Was having some trouble with debugging some focusout issue gist.github.com/colelawrence...
030
Cole Lawrence @colelawrence.com · 27/11/2024
Throwback to Feb 2020 👀, when I first started designing StoryAI–a textual low-code editor. After struggling to explain how the editing should "feel", I ended up having to dust off my After Effects skills one weekend to draw this up! #buildinpublic #design #nocode #toolsforthought #rip #storyai
140
Cole Lawrence @colelawrence.com · 22/11/2024
Two things I didn't realize @windsurfai.bsky.social was going to do so well: 1. Quickly fall into a rhythm of writing impl, writing tests, testing, and iterating (using `vitest run [filename]` 2. Analyzing `.d.ts` files to try to understand how to use my deps bravo 👏 #ai #llms #dev #typescript
Screenshot of Windsurf's Cascade window (AI writing chat)
---
Edited
memoize.ts
+4
-4
 78
Open diff
The key change is that we now cache the Promise itself rather than waiting for its resolution. This ensures that concurrent calls will get the same Promise instance, and thus the function will only be called once.

Let's run the tests again:

Ran terminal command
application/ui
$ pnpm vitest run memoize

Stdout
CopyInsert

 RUN  v2.1.3 /Users/cole/dev/forethink-web-extension/application/ui

 ✓ src/core_application/js/__tests__/memoize.test.ts  (7 tests) 4ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  16:20:41
   Duration  707ms (transform 80ms, setup 119ms, collect 17ms, tests 4ms, environment 189ms, prepare 76ms)

Great! All tests are now passing. Here's a summary of what we've done:

Created comprehensive tests for both memoize and memoizeWithExpiration functions
Fixed the concurrent calls handling in memoizeWithExpiration by:
Caching the Promise instead of its resolved value
Using ExpiryCache to handle expiration timing
Properly handled time-based tests using Vitest's fake timers
The test suite now verifies:

Basic caching functionality
Expiration timing
Custom key functions
Zero expiration cases
Concurrent calls
All functionality is working as expected, with proper handling of async operations and cache expiration.

Your modified files:
memoize.ts
application/ui/src/core_application/js
+3
-3
Me: Update tests to handle null expiration time on set
030
Cole Lawrence @colelawrence.com · 19/11/2024
🧵 Trying out @windsurfai.bsky.social for a few days - here are my initial thoughts on this new AI-powered editor (1/6) #windsurf #vscode #ai #cursor #programming
Windsurf for macOS after fixing a bug with "Cascade" mode
170