Skip to content

Instantly share code, notes, and snippets.

View tharropoulos's full-sized avatar
🐧
Breaking my i3wm (hyprland) config

Fanis Tharropoulos tharropoulos

🐧
Breaking my i3wm (hyprland) config
View GitHub Profile
@tharropoulos
tharropoulos / test.ts
Last active September 4, 2025 16:31
Upserting a document
import { Client } from "typesense";
const typesense = new Client({
nodes: [
{
host: "localhost",
port: 8108,
protocol: "http",
},
],
@tharropoulos
tharropoulos / shell.sh
Last active August 1, 2025 15:08
create analytics and migrate
#!/bin/bash
TYPESENSE_HOST="${TYPESENSE_HOST:-http://localhost:8108}"
TYPESENSE_API_KEY="${TYPESENSE_API_KEY:-xyz}"
curl -X POST "$TYPESENSE_HOST/collections" \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \
-d '{
"name": "products",
@tharropoulos
tharropoulos / hypr
Created June 21, 2025 09:49
hypr lid
bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1"
bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"
@tharropoulos
tharropoulos / t.md
Created May 9, 2025 21:05
Plo Orama
transition
flip

Orama Codebase Overview

An introduction to the project structure.


@tharropoulos
tharropoulos / guide.md
Created April 6, 2025 09:14
fix auth ais big ais

Apply changes

git apply auth.patch

Commit changes

rm auth.patch

Start Typesense instance

 export TYPESENSE_API_KEY=xyz

mkdir $(pwd)/typesense-data
mkdir $(pwd)/analytics-data

docker run -p 8108:8108 -v$(pwd)/typesense-data:/data typesense/typesense:29.0.rc5 \
  --data-dir /data --api-key=$TYPESENSE_API_KEY --enable-cors   --enable-search-analytics=true \
  --analytics-dir=analytics-data \
@tharropoulos
tharropoulos / gist:ce2854bf6a0f1dba137398683578a1c3
Last active March 7, 2025 08:48
Many-to-many relationships in Typesense

We'll create the collections in a specific order to handle references correctly:

  1. First, create basic collections (Movie, Person)
  2. Then, create relationship collections (MovieDirector)

1. Create Movie Collection

curl -X POST 'http://localhost:8108/collections' \
  -H 'X-TYPESENSE-API-KEY: YOUR_API_KEY' \
@tharropoulos
tharropoulos / guide.md
Created February 14, 2025 11:57
Markdown guide

Reproduction Guide

Failing commit

third

Steps to reproduce

  1. Create the collection
curl "http://localhost:8108/collections" \
    -X POST \
    -H "Content-Type: application/json" \

Create collection with embedding field of custom number of dimensions in the model_config

curl "http://localhost:8108/collections" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -d "$(jq -n \
        --arg api_key "$OPENAI_API_KEY" \
        '{
@tharropoulos
tharropoulos / flow.md
Created November 29, 2024 09:11
Typesense multi-node RAG leading to firing conversation lookup without including convo id in request

Create collection

curl "http://localhost:8108/collections" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -d '{
    "name": "pg-essays",
    "fields": [
        {