Chris Cook

Chris Cook

@zirkelc.dev

software engineer at heart ❤️ co-founder of http://flyweight.io aws community builder

330 followers405 following210 posts

TIL you can use `@entity.Attributes.Lambda.Function` to group messages from multiple different log groups. Useful when you need to analyze cold starts from many Lambdas with a single cloudwatch query.

Here's Lambdalet.AI - an AI-powered bookmarking and read-it-later service. It saves any page you're reading into your own Notion database — full text, fully searchable, zero fuss. I built this for the AWS Lambda Hackathon!

View full thread

Flow in a nutshell: 1️⃣ Lambda #1 uploads the HTML to S3 and queues requests 2️⃣ SQS FIFO for async processing and deduplication 3️⃣ Lambda #2 downloads HTML, converts to Markdown, extracts content via Bedrock and saves to Notion

Here's Lambdalet.AI - an AI-powered bookmarking and read-it-later service. It saves any page you're reading into your own Notion database — full text, fully searchable, zero fuss. I built this for the AWS Lambda Hackathon!

Bookmarklets are back! 🔖 It uses a small JS snippet saved as a bookmark to POST the current page's HTML to an API Gateway. If a site’s CSP blocks fetch, the code falls back to an old-school form submit in a temp window. Simple trick, but it works on most pages.

It would be nice if there was a way to pause Lambdas while waiting for a HTTP response. Like fire of a few requests, the Lambda goes into hibernate and automatically resumes when all requests have concluded.

TIL `$*` captures all positional arguments into a space separated string You can abuse this for a Git alias to avoid typing the commit message in double quotes: `gc my commit message`

I can't emphasize enough how great this post about quantization is!

Maarten Grootendorst@maartengr.bsky.social

Next up, "A Visual Guide to Quantization"! Over 60 custom visuals explaining quantization of LLMs. Explore (a)symmetric quantization, dynamic/static quantization, post-training techniques (e.g., GPTQ and GGUF), quantization-aware training (e.g., BitNet 1.58b), and more! #llms #ai

I wrote a follow up on this topic on @dev.to dev.to/zirkelc/type...

dev.toTypeScript CLI: Automate Build and Deploy ScriptsI would like to follow up on my previous post about TypeScript CLIs. Here's how I want to proceed: I...
Chris Cook@zirkelc.dev

I like to build local CLIs for my monorepo to automate build and deploy tasks that require more than just a few commands executed as npm scripts. By combining pnpm, commander.js and tsx, I can create executable programs in Typescript: ./cli <command> All the magic is in the shebang.

Building and deploying a React app to a static hosting service like Amazon S3 and CloudFront is a good example for a CLI in TypeScript. Adding Listr2 and Execa to create an easily extensible CLI with `build` and `deploy` command. asciinema.org/a/DFlVSxmoWD...

asciinema.orguntitledRecorded by zirkelc
Chris Cook@zirkelc.dev

I like to build local CLIs for my monorepo to automate build and deploy tasks that require more than just a few commands executed as npm scripts. By combining pnpm, commander.js and tsx, I can create executable programs in Typescript: ./cli <command> All the magic is in the shebang.

It's so funny how confident LLMs are when they make mistakes. The model generates invalid code. You specifically ask them about lines of code. The model confidently explains how it works. You give them the error. The model is like "Ah, you're absolutely right - I apologize for my mistake!"

I noticed that Vercels' popular `ms` pkg for converting time units to milliseconds uses 365.25 as a multiplier for the days in a year. I know this is to account for leap years, but is that the right assumption to make here? Effectively this means that `ms(1y) != ms(365d)` without ppl knowing it

Here's @tkdodo.eu original post where I saw this pattern for the first time. It's also the first time that using TypeScripts' `unqiue symbol` has made any sense to me. tkdodo.eu/blog/the-que...

Chris Cook@zirkelc.dev

Inspired by React Query's `queryOptions()`, I made a little helper to add the type of the parameter and the return type to the query definition (yes, I know about ORM). The next step would be to use template literal types to parse the parameters and return type from the query string.

Inspired by React Query's `queryOptions()`, I made a little helper to add the type of the parameter and the return type to the query definition (yes, I know about ORM). The next step would be to use template literal types to parse the parameters and return type from the query string.

I think I've finally found an efficient way to use LLMs for writing articles: 0. Draft article 1. Ask LLM to check the logic: does it make sense? No text changes 2. Ask LLM to fix spelling and grammar. No rewrites, only proofreading 3. Ask LLM to rewrite the text. Keep ideas, express them better

I released `aws-sigv4-sign` today. It contains the core logic for signing requests with AWS SigV4, but does not use the fetch API The question now is: if you use fetch, then use `aws-sigv4-fetch`. In all other cases (axios, got, ky, node:https...) use `aws-sigv4-sign` www.npmjs.com/package/aws-...

I use jest-dynalite to run DynamoDB locally to avoid mocking database calls. It's so fast that I can create the necessary items before each test and reset the whole database between test. It's really good! Btw, despite the name, it works with well @vitest.dev github.com/freshollie/j...

github.comGitHub - freshollie/jest-dynalite: Jest preset to run Dynalite (DynamoDB local) per test runnerJest preset to run Dynalite (DynamoDB local) per test runner - freshollie/jest-dynalite

It's crazy to think how different the experience must be for someone starting out in programming today vs. 15 years ago due to remote work and AI. When I started working in 2009, I learned so much by just sitting next to a person and watching them program.

Ordinal dates with year-dayOfYear (YYYY-DDD) even have an ISO standard. And the math is so simple, because days are absolute (24*60*60 s) whereas months are relative (28/30/31 d). Basically you only need to know if the year has 365 or 366 days. en.wikipedia.org/wiki/Ordinal...

Chris Cook@zirkelc.dev

Date and time is a fascinating topic. You basically only simple arithmetic (plus, minus, multiply, divide) to manipulate a millisecond value. It's weird how we've made it more complicated with calendars and timezones. Using ordinal numbers (day of the year) would simplify so much.

Date and time is a fascinating topic. You basically only simple arithmetic (plus, minus, multiply, divide) to manipulate a millisecond value. It's weird how we've made it more complicated with calendars and timezones. Using ordinal numbers (day of the year) would simplify so much.

TypeScript Function Overloading I used to overload functions where I merge the different parameter names and types into one implementation signature like `startOrLength`. But it get's really messy with more than 2 params. The usage of rest args offers a really nice alternative. /

The length of the rest args acts like a discriminator of the signature. If the function is called with one parameter it's the first signature, two parameters for the second signature, and so on.

TIL: Vitest has a built-in option to suppress logs during tests. I usually spy on the logger/console object and mock the implementation to disable logging during tests. It turns out Vitest has `onConsoleLog` option to filter or even suppress logs. vitest.dev/config/#onco...

Finally closing a long standing issue with AWS SigV4 fetch and Node.js `Request` object and it was quite simple: I didn't copy the `duplex` property to the signed request, which caused a `TypeError` in certain cases 🫣 Luckily, someone pointed my in the right direction github.com/zirkelc/aws-...

github.comNon-GET requests don't work when passed as a single Request argument · Issue #19 · zirkelc/aws-sigv4-fetchWhen passing a non-GET Request object as a single argument, the method is automatically changed to "GET".