Skip to content

Instantly share code, notes, and snippets.

CubeJS REST vs GraphQL для AI-агентов

Публичный API семантического слоя Cube Core всё чаще оказывается не «конечной точкой для BI-клиента», а контрактом, по которому AI-агент собирает аналитический запрос через function calling. Перед моделью среднего калибра (порядка 30B параметров в корпоративном контуре) встает практический вопрос: чем кормить контекст и какой инструмент объявить — JSON REST (/v1/load + /v1/meta) или автогенерируемый GraphQL (/cubejs-api/graphql). Оба транспорта сводятся к одному и тому же семантическому запросу Cube; GraphQL здесь — не ORM с вложенной выборкой сущностей, а тонкий фасад над тем же движком.[1] Ниже разобраны два учебных сценария с измерением объёма артефактов (оценка ≈4 символа ≈1 токен). Вердикт заранее: для 30B-агента REST с структурированным tool schema предсказуемее и дешевле по промпту, чем свободная GraphQL-строка. Эмпирический прогон deepseek/deepseek-v4-flash на сценарии 2 (ниже) это в целом подтверждает: GraphQL чаще схлопывает join в выдума

@artalar
artalar / with astro
Created April 28, 2026 18:48
RAM Infographic Astro Site
---
name: RAM Infographic Astro Site
overview: Define an authoritative, citation-backed taxonomy of DRAM standards and module form factors, then implement a static Astro educational infographic site—no speculative performance figures or forward-looking technology claims.
todos:
- id: facts-source-pass
content: "Authoritative content spec: JEDEC/industry definitions + vendor-cited examples only; explicit out-of-scope list"
status: pending
- id: astro-scaffold
content: Initialize Astro (Node 22+), TS strict, static output, global tokens + layout
status: pending

Христианство как сверх-рациональная стратегия: Взгляд через теорию игр

Главная идея

Доклад предлагает посмотреть на христианство не как на набор «иррациональных верований», а как на удивительно продуманную систему правил, которая решает одну из главных проблем человеческого общества: как заставить эгоистов сотрудничать друг с другом в больших группах?

Давайте разберём каждый пункт простыми словами.


@artalar
artalar / prompt.md
Created September 19, 2025 11:54
Example of AI refactorign proper prompt

You need to find all files recursively in the project folder "js" with this pattern inside file code: "memo(_" (not regexp, strict comparison) and for each file run separate subtack with following instructions:


You need to refactor the component declaration and move the "memo" decorator to the original component, removing extra "_Component" variable. For components with TypeScript generics use import { memoGeneric } from '@/js/libs/memo';

Examples:

// FROM const _Table = (props: T) => ;

@artalar
artalar / index.jsx
Last active August 29, 2025 11:01
Components composition
export const Base = () => {
return (
<Dialog.Root>
<Tooltip.Root>
<Tooltip.Trigger>
<Dialog.Trigger>
<MyButton aria-label="Open dialog">Open dialog</MyButton>
</Dialog.Trigger>
</Tooltip.Trigger>
<Tooltip.Portal>…</Tooltip.Portal>
@artalar
artalar / Link.tsx
Created August 26, 2025 09:32
Link component for @reatom/react
#!/usr/bin/env node
import { execSync } from "child_process"
import { createHash } from "crypto"
import { mkdir, readFile, writeFile } from "fs/promises"
const cacheDir = "./node_modules/.cache"
const cachePath = `${cacheDir}/deps_check_lock_hash.txt`
await mkdir(cacheDir, { recursive: true }).catch(() => {})
@artalar
artalar / inbox.md
Last active July 14, 2025 08:25
Jazz Inbox feature example

Jazz Inbox: RPC-like Server Endpoints

Server Setup

Before implementing inbox-based endpoints, you need to set up a Jazz server worker.

Generating Worker Credentials

Server workers have Jazz accounts with static credentials. Generate new credentials by running:

You need to implement a STUNNING landing page for Reatom state manager in@index.astro. Sections (screens):

  • title "Reatom - state managers for any kind of apps", describtion: "Lightest and simpliest at start, extreamly feature-rich for a grow". Add beatiful gradient. Need some fancy aniated background.
  • features (each in a unique beatiful floating card):
    • signal architecture
    • small and performant
    • forms
    • router
    • most advanced async management
    • HUGE amount of small helpers
  • framework agnostic and microfrontend-friendly

Ралли Приключений

Настольная гоночная игра для 2-4 игроков в возрасте от 6 лет.

Правила игры

Необходимые компоненты

  • Игровое поле (6 секций карты)
  • Фигурки машинок (Hot Wheels или аналогичные)
  • Кубик с 6 гранями