Skip to content

Instantly share code, notes, and snippets.

View ZmeiGorynych's full-sized avatar

Egor Kraev ZmeiGorynych

View GitHub Profile
@ZmeiGorynych
ZmeiGorynych / coderabbit_claude_code_command.md
Created October 26, 2025 11:22
A Claude Code command for calling coderabbit cli.

Run coderabbit review --plain to get comprehensive code analysis and improvement suggestions. Apply the feedback to write cleaner, more maintainable code.

Only run this from a git repository root directory.

Before running the command, check whether the codebase has any changes since the last commit, if yes just call the command normally, if not first ask the user what they want to use as a baseline: previous commit, the moment when the branch was first created, the codebase as a whole, etc, and use the corresponding option from the below.

ALWAYS use the --config command and attach ALL CLAUDE.md files that you yourself would have used to write code in this repo (so global-level, repository-level, and any contained deeper down in the repo).

Available options for the coderabbit review command:

@ZmeiGorynych
ZmeiGorynych / rollup.md
Created October 22, 2025 07:18
Rollup instructions

Add to the sqlmodels_to_cubes function in @storyline/storyline/local/sql_to_cube a new parameter rollup_references: bool = True, and an optional parameter additional_joins: List[JoinSpec] = None Here JoinSpec is

class JoinSpec(BaseModel):
    left_column: Tuple[str, str]  # (table_name, column_name)
    right_column: Tuple[str, str]  # (table_name, column_name)
    join_type: str = "left"
 relationship: str = "many_to_one"
@ZmeiGorynych
ZmeiGorynych / pydantic_dataframe.py
Created July 11, 2025 10:58
A Pydantic wrapper for pd.DataFrame that serializes/deserializes nicely to json
import pandas as pd
from pydantic import BaseModel, field_validator, field_serializer, ConfigDict
from typing import Any, Union
class PydanticSerializableDataFrame(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
df: pd.DataFrame
@field_serializer("df")
import os
import logging
from typing import Callable, Any
import cloudpickle
logger = logging.getLogger(__name__)
def cached_call(func: Callable, filename: str, force: bool = False) -> Any:
@ZmeiGorynych
ZmeiGorynych / run.sh
Last active April 25, 2025 12:22
A shell file to ask your coding agent to run each time it invokes a Python-related command
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 env_file [command...]"
echo "The conda environment name will be read from CONDA_ENV_NAME in the env file"
echo "env_file is required and must be provided as the first argument"
echo "Any additional arguments will be executed as a command after activating the environment"
exit 1
}
@ZmeiGorynych
ZmeiGorynych / filter_matches
Created January 22, 2025 14:40
Direct evaluation of LlamaIndex's MetadataFilters on instances of BaseNode, supporting arbitrary nesting of conditions
from typing import Union
from llama_index.core.schema import BaseNode
from llama_index.core.vector_stores import (
MetadataFilter,
MetadataFilters,
FilterOperator,
FilterCondition,
)
@ZmeiGorynych
ZmeiGorynych / parallel.py
Created September 16, 2024 14:21
A threading approach to concurrently calling IO-blocked functions such as LLMs
from typing import Callable, Iterable
import logging
import concurrent.futures
logger = logging.getLogger(__name__)
def process_batch_parallel(
function: Callable,
batched_args: Iterable,