Command Palette
Search for a command to run...
Comments
Join the discussionNo comments yet. Be the first to comment.
Today I Learned
In this series, I post short notes about the stuff, that I've recently learned.
React Query: Execution order of useMutation side effects
Today I learned, what is the actual order of execution of React Query useMutation side effects. Given a mutation like this: const mutation = useMutation( (id) => { console.log('Mutation callback') return toggleTodo(id) }, { ...
More from this blog
How to split string to strings of equal length in JavaScript?
Solution 'abcdabcdabcdabcdabcd'.match(/.{1,4}/g) // ['abcd', 'abcd', 'abcd', 'abcd', 'abcd'] Here's original StackOverflow answer. Context In today's Advent of Code challenge, I had to simulate drawing pixels on 40x6 CRT screen. First I computed li...
Advent of Code - preparing input data
When solving Advent of Code puzzles, sometimes you will come across an input data, that consist of two parts: configuration and instructions: [S] [C] [Z] [F] [J] [P] [T] [N] [G] [H] [G] [Q] [G] [D] ...
Improve your problem solving skills with Advent of Code
It's December already, so it's time for another edition of Advent of Code. Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. I usu...
How to query image dimensions from Sanity?
I haven't used Sanity before, so it took me a while to figure out, how to get photos dimensions using GROQ queries. Here's how I've done it: GROQ query export const query = groq` *[_type == "photo"] { image{ "dimensions": asset->metadata...
