Chris Cook
Chris Cook
@zirkelc.dev
software engineer at heart ❤️ co-founder of http://flyweight.io aws community builder
330 followers405 following210 posts
I'm already working on improvements like auto-generated tags and summaries, and tougher CSP work-arounds. Check out the code and give it a star! ⭐ github.com/zirkelc/lambdalet
Chris Cook reposted
✍️ New blog post by Chris Cook Flatten Array of Arrays using JSONata for AWS Step Functions #aws #programming #tutorial #javascript
Glad it's open source github.com/gskinner/reg...
Looks like my favorite Regex testing site is down 😭 regexr.com
Looks like my favorite Regex testing site is down 😭 regexr.com
In 2011, there was an proposal to change the type of null `typeof null === null` Too bad it didn't get accepted web.archive.org/web/20160331...
Maybe soon we can use response streaming from AWS Lambda with @trpc.io 👀 github.com/trpc/trpc/pu...
Found this TODO in my codebase 😄 If I make a PR, will @vitest.dev accept it? 👀
I started a discussion for a new asymmetric matcher for @vitest.dev that checks if a property does not exist. Basically, the opposite of `expect.anything()`, could be named `expect.nothing()` Would love to get some feedback 🙏 github.com/vitest-dev/v...
I can't emphasize enough how great this post about quantization is!
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
It's funny, @sindresorhus.bsky.social has a package for literally everything I search for. I should probably prefix my Google searches with "site:github.com/sindresorhus/"
I wrote a follow up on this topic on @dev.to dev.to/zirkelc/type...
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...
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.
I always wondered how people create these beautiful terminal recordings. github.com/asciinema/as...
What if `expect(obj).toMatchPrompt("...")` was a thing It's probably a stupid idea, but I couldn't resist and quickly implemented @vitest.dev custom matcher
I love how you can use TypeScripts' unique symbols as a parking spot for types 👀 Here's a simple query helper function to attach the result type to an object and infer it back later I've shared a complete example on @dev.to: dev.to/zirkelc/uniq...
Just found out about Microsofts' GenAIScript and not sure how to feel about it Anyone tried it yet? github.com/microsoft/ge...
Vitest v3 has just been released 👀 github.com/vitest-dev/v...
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...
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 just stumbled upon `unbuild` from @unjs.io Bundling for ESM and CJS is already super easy thanks to `tsup`, but `unbuild` looks even nicer! github.com/unjs/unbuild
Some packages like Chalk by @sindresorhus.bsky.social are so popular that you can literally run for years without issues before you notice that you missed to declare it as dependency.
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-...
@arethetypeswrong doesn't support @pnpm.io `publishConfig` to override package.json export fields when using live types As workaround, we can run pnpm pack, extract the tarball name and pass it to @arethetypeswrong to check the types: `pnpm pack | tail -n1 | xargs attw` github.com/arethetypesw...
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...
Chris Cook reposted
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...
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.
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-...
ElectroDB in my opinion is the best library to work with DynamoDB github.com/tywalch/elec...
Wild that you can implement merge sort as type in TypeScript github.com/saiashirwad/...