Sign in

Rostislav Melkumyan

@rosti.no
59 followers 88 following 24 posts

Breaking stuff at @sanity.io

PostsRepliesMedia
Rostislav Melkumyan @rosti.no · 06/09/2026
swe today in a nutshell
000
Rostislav Melkumyan @rosti.no · 10/04/2026
020
Rostislav Melkumyan @rosti.no · 09/03/2026
react-logo-soup is now @sanity-labs/logo-soup 🪅 logo-soup.sanity.dev/docs
010
Rostislav Melkumyan @rosti.no · 07/02/2026
i collapsed it into 1 pass over a Uint32Array, downsampled to ~45x45, reused canvases at module level, and added caching so changing baseSize/scaleFactor doesn’t re-scan content detection: 1.4ms -> 37us per logo (38x) full mount: 29ms -> 828us for 20 logos (35x) github.com/sanity-labs/...
for (let i = 0; i < pixelCount; i++) {
  const pixel = data32[i]!;

  // unpack RGBA from Uint32Array (little-endian)
  const a = pixel >>> 24;
  if (a <= contrastThreshold) continue;

  const r = pixel & 0xff;
  const g = (pixel >>> 8) & 0xff;
  const b = (pixel >>> 16) & 0xff;

  // squared euclidean distance from white
  const distSq = (r - 255) ** 2 + (g - 255) ** 2 + (b - 255) ** 2;
  if (distSq < contrastDistanceSq) continue;

  // recover x,y from flat index
  const x = i % sw;
  const y = (i - x) / sw;

  // accumulate weighted visual center
  totalWeight += distSq * a;
  weightedX += (x + 0.5) * distSq * a;
  weightedY += (y + 0.5) * distSq * a;
120
Rostislav Melkumyan @rosti.no · 06/02/2026
fun css tip from yesterday's react-logo-soup post: if you render logos as inline-block, the browser treats them like words. which means css text-wrap: balance just works. it distributes logos evenly across lines instead of leaving one sad orphan on the last row
061
Rostislav Melkumyan @rosti.no · 06/05/2025
i love groq sm <3
Code block with the following code:
```groq
export const headingsProjection = \`
  _key,
  "title": array::join(children[].text, ""),
  "level": select(
    style == "h2" => 2,
    style == "h3" => 3
  )
\`
```
020
Rostislav Melkumyan @rosti.no · 25/02/2025
how to become a millionaire
A Git commit message with the text "feat: remove next/image usage"
000
Rostislav Melkumyan @rosti.no · 02/01/2025
020
Rostislav Melkumyan @rosti.no · 19/12/2024
You can now init a new Sanity project with a remote template! Here are some to get you started: $ npm create sanity@latest -- --template sanity-io/sanity-template-astro-clean sanity-io/sanity-template-nextjs-clean sanity-io/sanity-template-sveltekit-clean sanity-io/sanity-template-remix-clean
0209
Rostislav Melkumyan @rosti.no · 06/12/2024
Bibbidi-Bobbidi-Boo
010
Rostislav Melkumyan @rosti.no · 27/11/2024
idk if arc will even get new features anymore, but a @vercel.com integration is all i want for xmas
000
Rostislav Melkumyan @rosti.no · 16/11/2024
These are just bad code ligatures tho. Fira's is better imo
100